ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Sorter macro (https://www.excelbanter.com/excel-programming/312358-sorter-macro.html)

scottwilsonx[_48_]

Sorter macro
 

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

--
scottwilson
-----------------------------------------------------------------------
scottwilsonx's Profile: http://www.excelforum.com/member.php...fo&userid=1112
View this thread: http://www.excelforum.com/showthread.php?threadid=26603


Tom Ogilvy

Sorter macro
 
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.

--
Regards,
Tom Ogilvy


"scottwilsonx" wrote in message
...

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 part
of the spreadsheet on a monthly basis, ie: AG is Apr-03 and BD will
contain Mar-05 (when it arrives)

What I would like to do is create a VBA macro that sorts the data by
the values in the most recent month. I would call this from cell BG71
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 data
alphabetically by the row contents in each row of column AG.

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


--
scottwilsonx
------------------------------------------------------------------------
scottwilsonx's Profile:

http://www.excelforum.com/member.php...o&userid=11128
View this thread: http://www.excelforum.com/showthread...hreadid=266032





All times are GMT +1. The time now is 03:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com