#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Jay Jay is offline
external usenet poster
 
Posts: 671
Default data

I have the following data in one worksheet:

abc red 1
abc blue 2
abc green 3
edf red 3
edf orange 5
edf purple 4

I need a formula to do the following sort in new worksheet:

abc red 1 abc blue 2 abc green 3
edf red 3 edf orange 5 edf purple 4

When I use the Vlookup formula, it only searches the first top results, but
I need it to search the next on at the bottom, until there isn't any abc or
edf left.

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

Say your original data is in Sheet1 and the destination is Sheet2. This this
small macro:

Sub reorderThem()
Set s1 = Sheets("Sheet1")
Set s2 = Sheets("Sheet2")
s1.Activate
n = Cells(Rows.Count, "A").End(xlUp).Row
Range("A1:C1").Copy s2.Range("A1")
i = 1
j = 4
For k = 2 To n
If Cells(k, 1).Value < Cells(k - 1, 1).Value Then
i = i + 1
j = 1
End If
Range("A" & k & ":C" & k).Copy s2.Cells(i, j)
j = j + 3
Next
End Sub


Starting with:

alpha green 4
alpha happy 45
alpha ugly 99
beta first 1
beta second 2
beta third 3
gamma xx 1
gamma yy 2
zeta qwerty poiuy
zeta ytrewq yuiop


It will make:

alpha green 4 alpha happy 45 alpha ugly 99
beta first 1 beta second 2 beta third 3
gamma xx 1 gamma yy 2
zeta qwerty poiuy zeta ytrewq yuiop

--
Gary''s Student - gsnu200825


"JAY" wrote:

I have the following data in one worksheet:

abc red 1
abc blue 2
abc green 3
edf red 3
edf orange 5
edf purple 4

I need a formula to do the following sort in new worksheet:

abc red 1 abc blue 2 abc green 3
edf red 3 edf orange 5 edf purple 4

When I use the Vlookup formula, it only searches the first top results, but
I need it to search the next on at the bottom, until there isn't any abc or
edf left.

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
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 10:57 AM.

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

About Us

"It's about Microsoft Excel"