Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default (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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I insert a earlier date and sort it chronologicaly? larry New Users to Excel 1 March 10th 09 03:11 PM
Chart Class Module/follow on question to hyperlink post earlier. Rominall Charts and Charting in Excel 2 March 7th 07 02:43 AM
Getting a hyperlink to follow a sort Andybanker Excel Discussion (Misc queries) 7 June 26th 06 07:39 PM
Formatting doesn't follow data sort kanimalhouse Excel Discussion (Misc queries) 1 September 7th 05 11:16 PM
Sort order for characters & symbols - does anything follow z? Neil Goldwasser Excel Discussion (Misc queries) 4 August 5th 05 05:02 AM


All times are GMT +1. The time now is 08:31 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"