ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How "memorize/save" sort in ExcelXP (https://www.excelbanter.com/excel-programming/358803-how-memorize-save-sort-excelxp.html)

George[_23_]

How "memorize/save" sort in ExcelXP
 
I'm using ExcelXP(2003), and frequently do data sorts, like Column A first,
then Column B, then press "sort".

But I have to keep entering this every time. Isn't there a way to "save"
the sort along with saving the spreadsheet?

Thanks,
George



cm_gmail[_2_]

How "memorize/save" sort in ExcelXP
 

The easiest way is to record a macro. Something that you do frequentl
can be automated by simply using Tools|Macro|Record new macro. Then
just do your repetitive function and stop the recording.

For your example, I highlighted my data to get the selection before th
macro started so the selecting would not be part of the macro. Then,
hit Tools|Macro|Record new macro. Then, Data|Sort and filled it ou
how I wanted. Sorted and stopped the macro.

The resulting code was:

Code
-------------------
Selection.Sort Key1:=Range("A3"), Order1:=xlAscending, Key2:=Range("B3") _
, Order2:=xlDescending, Header:=xlGuess, OrderCustom:=1, MatchCase:= _
False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, DataOption2 _
:=xlSortNormal

-------------------


Not too bad. Pretty easy. From there, you edit the code if you wan
or leave it as-is.

If I did it frequently enough, I would create a toolbar button for th
macro.

Fun stuff. Good luck

--
cm_gmai
-----------------------------------------------------------------------
cm_gmail's Profile: http://www.excelforum.com/member.php...fo&userid=3345
View this thread: http://www.excelforum.com/showthread.php?threadid=53259


Patricia Shannon

How "memorize/save" sort in ExcelXP
 
Have you tried recording a macro?

"George" wrote:

I'm using ExcelXP(2003), and frequently do data sorts, like Column A first,
then Column B, then press "sort".

But I have to keep entering this every time. Isn't there a way to "save"
the sort along with saving the spreadsheet?

Thanks,
George




[email protected]

How "memorize/save" sort in ExcelXP
 
I am not sure about saving the sort, but you could write a macro to do
the sort...hit the record button under tools Macro, then hit stop after
you are done....then run it when you want...good luck!


George[_23_]

How "memorize/save" without a macro...
 
Thanks,

Macro looks like a good way to go, but I was hoping to find a non-macro way.
So far, haven't found.

What's really baffling is that I've pulled up some old spreadsheets, and the
sort is exacltly like I want upon opening the file (let's say it's sort on
1st-ColumnB, 2nd-ColumnA, 3rd, ColumnG.

But spreadsheets created more recently (past year or 2 or 3) don't "hold"
the sort...even if you save the file. Once you exit and then re-open, it
flops back to some default like blank spaces for the sort fields.

Still looking,
George




All times are GMT +1. The time now is 10:22 AM.

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