Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Thanks to Tom who replied to my earlier email. I have made some alterations, which are detailed below: Data range from B5 to Z37 where row 5 is the header showing Apr-03 t Mar-05 in C5 to Z5. and where column B contains the row headers. My sort macro looks like this: Sub SORT() Dim SortMonth As Integer Range("B2").Value = SortMonth Range("B5:Z37").Select Selection.SORT Key1:=Range(SortMonth), Order1:=xlAscending End Sub It isn't working properly. I have created a SortMonth dimension whic is based on the value in cell B2. What I would like to do is where th Selection.Sort looks for a range, I want it to look in B2 and take tha value, which is equivalent to the months in C5 to Z5. Thanks for your help. Regards Scott -- scottwilson ----------------------------------------------------------------------- scottwilsonx's Profile: http://www.excelforum.com/member.php...fo&userid=1112 View this thread: http://www.excelforum.com/showthread.php?threadid=26638 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
sorting columns when cell results based on other cells | Excel Worksheet Functions | |||
sorting worksheets based on a cell value | Excel Worksheet Functions | |||
Sorting cell data based on values | Excel Discussion (Misc queries) | |||
Excel should allow sorting and filtering based on cell color. | Excel Worksheet Functions | |||
Sorting data based on validation cell | Excel Programming |