Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / September 2007

Tip: Looking for answers? Try searching our database.

data on top

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
k743911@gmail.com - 18 Sep 2007 15:13 GMT
hello ,

can anyone help with this,

i have series of data segregated like this

example:

richard
kenny
smith
john
raju

i want the output like this . i want smith to be positioned in the
first place always and should not be repeated

it should be like this

smith
richard
kenny
john
raju

can anyone help me with a formula

thans
Gary''s Student - 18 Sep 2007 16:28 GMT
Select your list and run:

Sub smith()
Dim savit()
ReDim savit(Selection.Count)
i = 0
foundit = False
For Each r In Selection
   With r
   If .Value = "smith" Then
       foundit = True
   Else
       savit(i) = .Value
       i = i + 1
   End If
   End With
Next

If foundit Then
   i = 0
   j = 0
   For Each r In Selection
       If j = 0 Then
           Selection.Cells(1) = "smith"
           j = 1
       Else
           r.Value = savit(i)
           i = i + 1
       End If
   Next
End If
End Sub
Signature

Gary''s Student - gsnu2007

> hello ,
>
[quoted text clipped - 24 lines]
>
> thans
k743911@gmail.com - 19 Sep 2007 07:59 GMT
On Sep 18, 8:28 pm, Gary''s Student
<GarysStud...@discussions.microsoft.com> wrote:
> Select your list and run:
>
[quoted text clipped - 62 lines]
>
> - Show quoted text -

hi gary ,

thanks a lot ..
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.