Sorter macro

S

scottwilsonx

Hello All, I would be grateful for any help with this.

I have a data range from AG72 to BD103 where row 72 is the header.
The range is cumulative, and calculates the results from another par
of the spreadsheet on a monthly basis, ie: AG is Apr-03 and BD wil
contain Mar-05 (when it arrives)

What I would like to do is create a VBA macro that sorts the data b
the values in the most recent month. I would call this from cell BG7
by selecting from a validation drop-down list of months.

Is this macro possible? and if so how ?

Also, is it possible to have a second macro that would resort the dat
alphabetically by the row contents in each row of column AG.

Hope this makes sense, and I look forward to your replies.
Thanks
Scott
 
T

Tom Ogilvy

Just do the sort manually with the macro recorder turned on. You would want
to then modify the setting for the Key1 argument. It isn't clear what
labels are in row 72, so it is hard to provide specifics on how to find the
month specified in BG70 [sic]. Worst case you can loop along the row to
find it.

For the second, again, use the macro recorder. Since this will be static,
you shouldn't need any major modifications.

In each case you can modify the base range to be

Range("AG72").Currentregion

You will need to have a blank row and column surrounding your data, so you
need your drop down in BG70 rather than BG71.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top