Sorting Automatically
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
|