Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I have many worksheets in a shared workbook. My users will input data on any
or all sheets. I would like the sheets to automatically sort (by 3 columns - Sales Agent; Customer; Invoice#) when they exit the file. I created a macro to do the sort. So, if I hit CTRL-S it will sort just fine but I'd rather it be done automatically. Can anyone help me with this? Thanks! Paula |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
one method would be to call sort macro in closing. add the following
private sub Auto_Close call sortmacro end sub "paulas" wrote: I have many worksheets in a shared workbook. My users will input data on any or all sheets. I would like the sheets to automatically sort (by 3 columns - Sales Agent; Customer; Invoice#) when they exit the file. I created a macro to do the sort. So, if I hit CTRL-S it will sort just fine but I'd rather it be done automatically. Can anyone help me with this? Thanks! Paula |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I wouldn't put it in the auto_close or before_close procedure. The user may say
no to the "do you want to save your changes?" prompt. Instead, run the code when the user opens the workbook. Option Explicit Sub Auto_Open() 'code to do the sort 'or call YourProcedureThatSortsTheDataHere End sub This would go in a general module--not behind thisworkbook. paulas wrote: I have many worksheets in a shared workbook. My users will input data on any or all sheets. I would like the sheets to automatically sort (by 3 columns - Sales Agent; Customer; Invoice#) when they exit the file. I created a macro to do the sort. So, if I hit CTRL-S it will sort just fine but I'd rather it be done automatically. Can anyone help me with this? Thanks! Paula -- Dave Peterson |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thank you! That's what I needed!!
"Dave Peterson" wrote: I wouldn't put it in the auto_close or before_close procedure. The user may say no to the "do you want to save your changes?" prompt. Instead, run the code when the user opens the workbook. Option Explicit Sub Auto_Open() 'code to do the sort 'or call YourProcedureThatSortsTheDataHere End sub This would go in a general module--not behind thisworkbook. paulas wrote: I have many worksheets in a shared workbook. My users will input data on any or all sheets. I would like the sheets to automatically sort (by 3 columns - Sales Agent; Customer; Invoice#) when they exit the file. I created a macro to do the sort. So, if I hit CTRL-S it will sort just fine but I'd rather it be done automatically. Can anyone help me with this? Thanks! Paula -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
sorting automatically | New Users to Excel | |||
sorting range automatically | Excel Discussion (Misc queries) | |||
Automatically sorting data | Excel Discussion (Misc queries) | |||
Sorting Data Automatically | Excel Discussion (Misc queries) | |||
sorting automatically | Excel Worksheet Functions |