Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sorting macro
I have a worksheet with a large range of data. I would like to create a
macro that will read through the data, sort it out by city, and paste each "city group" of information on a new sheet with two rows between them. I would also like to assign that macro to a button that I can click to run it. Any suggestions? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sorting macro
Range("A1").currentRegion.copy _
Destination:=Worksheets(2).Range("A1") worksheets(2).Range("A1").CurrentRegion.Sort Key1:=Range("A1"), _ xlHeader:=Yes with worksheets(2) for i = cells(rows.count,1).End(xlup).row to 3 step -1 IF cells(i,1) < cells(i+1,1) then cells(i,1).Resize(2).EntireRow.Insert end if Next End With -- Regards, Tom Ogilvy "Sapphire69" wrote in message ... I have a worksheet with a large range of data. I would like to create a macro that will read through the data, sort it out by city, and paste each "city group" of information on a new sheet with two rows between them. I would also like to assign that macro to a button that I can click to run it. Any suggestions? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Sorting in a macro | Excel Programming | |||
Sorting macro | Excel Programming | |||
Macro for Sorting | Excel Programming | |||
Sorting with a macro? | Excel Programming | |||
Sorting w/Macro | Excel Programming |