Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have some data in column "A" and random numeric values in column
"B". I want to sort column "A" based on the ascending order of column "B". I was able to do it manually by selecting both the columns and sorting. But i dont know how to do it in a macro... |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi
Dim r As Range Set r = Range("A1", Range("A1").End(xlDown).Offset(0, 1)) r.Sort Key1:=Range("B1"), Order1:=xlAscending, _ Header:=xlGuess, OrderCustom:=1, MatchCase:=False, _ Orientation:=xlTopToBottom, DataOption1:=xlSortNormal when ever you hit a syntax snag, do what i do. turn on the recorder and perform the desired actions manually. most of the time, the recorder will show you the basic syntax and give you a basic idea of how to code it. sometimes editing is reguired but you do get the basic idea. very helpful for people just starting out. Regards FSt1 " wrote: I have some data in column "A" and random numeric values in column "B". I want to sort column "A" based on the ascending order of column "B". I was able to do it manually by selecting both the columns and sorting. But i dont know how to do it in a macro... |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Fill a column with the contents of another column based on a choic | Excel Discussion (Misc queries) | |||
Button To Sort Sheet Contents On Column? | Excel Programming | |||
Fill in contents based on another column | Excel Programming | |||
Fill in contents based on another column | Excel Worksheet Functions | |||
move contents of column C based on criteria related to column A | Excel Discussion (Misc queries) |