Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
(Follow-up to earlier sort question) Further help required
Hello all: Here is my VBA: Sub SORT() Dim SortMonth As Date SortMonth = Range("B2").Value Range("B6:Z36").Select Selection.SORT Key1:=Columns(SortMonth), Order1:=xlAscending End Sub Where the value of B2 is dependent upon a drop down list, but is alway a date: eg: March 2003 is 01/03/2003. And B6:Z36 is the range I want t sort. In C2 there is a lookup against the contents of B2 and this allocates reference to each month in the validation list. eg: April 2003 is C where C is the column that April 2003 is located in the spreadsheet. What I would like is: for everytime the user changes the month in B2 they can then resort the data and the Selection.Sor Key1:=Columns(SortMonth), will tell Excel what column to look at. Thanks for any help -- scottwilson ----------------------------------------------------------------------- scottwilsonx's Profile: http://www.excelforum.com/member.php...fo&userid=1112 View this thread: http://www.excelforum.com/showthread.php?threadid=26646 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How can I insert a earlier date and sort it chronologicaly? | New Users to Excel | |||
Chart Class Module/follow on question to hyperlink post earlier. | Charts and Charting in Excel | |||
Getting a hyperlink to follow a sort | Excel Discussion (Misc queries) | |||
Formatting doesn't follow data sort | Excel Discussion (Misc queries) | |||
Sort order for characters & symbols - does anything follow z? | Excel Discussion (Misc queries) |