View Full Version : Macro - need to start and end with the same data sort


msarnie
05-13-2010, 05:51 AM
Again - I have a large spreadsheet with one column that has Fund#. The users frequently sort the spreadsheet on a number of different columns. I created a macro that must have the column Fund# in ascending order. So - when I first begin the Macro I re-sort the spreadsheet based on Fund#.

The problem - users don't like the fact that the macro re-sorts the spreadsheet when they run the Macro.

Anyway of detecting the sort order of the spreadsheet before running the Macro so when I'm done running the code I then can put the spreadsheet back to the original sort.

chergh
05-13-2010, 06:46 AM
Not as far as I know.

boblarson
05-13-2010, 01:57 PM
What does the macro do? Perhaps you can just have it add a hidden spreadsheet and copy the data over, do the sort and return the values you want while leaving the user's sheet untouched. :)

chergh
05-14-2010, 12:51 AM
Copying data backwards and forwards between hidden sheets is not a good solution IMO.

If your users commonly sort sheets in a particular ways then you could create macros to sort the sheets automatically and then your users just need to click one button to get the layout they want.