Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am using Excel 2010 and I have some "sort code" that is the result
of the macro recorder. Is there anything that I can use in place of G2:G109 as the range address? The data can be more or less the next time that I run the macro and therefore I'd rather not use a hard coded range. I tried using things like xlDown and few other things that I found from research but nothing really worked. Thanks very much. 'sort ActiveWorkbook.Worksheets("My Calcs").Sort.SortFields.Clear ActiveWorkbook.Worksheets("My Calcs").Sort.SortFields.Add Key:=Range( _ "G2:G109"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _ xlSortNormal With ActiveWorkbook.Worksheets("My Calcs").Sort .SetRange Range("A1").CurrentRegion .Header = xlYes .MatchCase = False .Orientation = xlTopToBottom .SortMethod = xlPinYin .Apply End With |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Sorting Question | Excel Discussion (Misc queries) | |||
Re my question on sorting | Excel Worksheet Functions | |||
Sorting question-is this possible | Excel Programming | |||
Sorting Question | Excel Programming | |||
Sorting question | Excel Programming |