Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Sorting Automatically

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 354
Default Sorting Automatically

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default 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
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Sorting Automatically

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
sorting automatically abolbashari New Users to Excel 2 August 20th 08 09:10 PM
sorting range automatically lela2a Excel Discussion (Misc queries) 1 July 1st 08 08:46 PM
Automatically sorting data leehutch Excel Discussion (Misc queries) 4 August 22nd 05 06:36 AM
Sorting Data Automatically Alan Bartley Excel Discussion (Misc queries) 1 December 8th 04 01:51 PM
sorting automatically Mike Lemke Excel Worksheet Functions 2 October 31st 04 06:51 PM


All times are GMT +1. The time now is 12:02 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"