#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default data on top

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default data on top

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
--
Gary''s Student - gsnu2007


" wrote:

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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default data on top

On Sep 18, 8:28 pm, Gary''s Student
wrote:
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
--
Gary''s Student - gsnu2007



" wrote:
hello ,


can anyone help with this,


i have series ofdatasegregated 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- Hide quoted text -


- Show quoted text -


hi gary ,

thanks a lot ..


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Increase Your Business By Data Conversion, Data Format and Data EntryServices in India Data Entry India Excel Worksheet Functions 1 March 31st 08 12:51 PM
Save 20% On Data Conversion and Data Formats Services by Data EntryIndia Data Entry India Excel Discussion (Misc queries) 0 March 31st 08 12:00 PM
Data Entry Online, Data Format, Data Conversion and Data EntryServices through Data Entry Outsourcing [email protected] Excel Discussion (Misc queries) 0 March 20th 08 12:45 PM
Import Data / Edit Data / Export Data in Excel Mathias Fritsch Excel Programming 0 July 19th 07 04:08 PM
MULTIPLE DATA - How to insert new data into existing data.... Rodorodo Excel Discussion (Misc queries) 0 December 15th 06 11:50 PM


All times are GMT +1. The time now is 03:17 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"