#1   Report Post  
Posted to microsoft.public.excel.misc
Cordobes
 
Posts: n/a
Default Deactivate worksheet

I want to reorganize and sort a good amount of information on a worksheet,
right before it is deactivate it.

The problem is that when the event deactivate is running, the active sheet
is no longer the one being deactivated, so I have to select it back again,
making it the active sheet, and put in place a set of boolean variables, to
know if this action is taking place before deactivating the sheet, or under a
regular activation.

Any suggestions?
  #2   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default Deactivate worksheet

If you use the Workbook_SheetDeactivate event, there is sheet argument which
refers tro the sheet exited from.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Cordobes" wrote in message
...
I want to reorganize and sort a good amount of information on a worksheet,
right before it is deactivate it.

The problem is that when the event deactivate is running, the active sheet
is no longer the one being deactivated, so I have to select it back again,
making it the active sheet, and put in place a set of boolean variables,

to
know if this action is taking place before deactivating the sheet, or

under a
regular activation.

Any suggestions?



  #3   Report Post  
Posted to microsoft.public.excel.misc
Cordobes
 
Posts: n/a
Default Deactivate worksheet

Could you explain a little bit further, maybe with an example.

Thanks.

"Bob Phillips" wrote:

If you use the Workbook_SheetDeactivate event, there is sheet argument which
refers tro the sheet exited from.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Cordobes" wrote in message
...
I want to reorganize and sort a good amount of information on a worksheet,
right before it is deactivate it.

The problem is that when the event deactivate is running, the active sheet
is no longer the one being deactivated, so I have to select it back again,
making it the active sheet, and put in place a set of boolean variables,

to
know if this action is taking place before deactivating the sheet, or

under a
regular activation.

Any suggestions?




  #4   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default Deactivate worksheet

Try this code



Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
MsgBox "Previous sheet was" & Sh.Name
MsgBox "Active sheet is " & ActiveSheet.Name
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Cordobes" wrote in message
...
Could you explain a little bit further, maybe with an example.

Thanks.

"Bob Phillips" wrote:

If you use the Workbook_SheetDeactivate event, there is sheet argument

which
refers tro the sheet exited from.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Cordobes" wrote in message
...
I want to reorganize and sort a good amount of information on a

worksheet,
right before it is deactivate it.

The problem is that when the event deactivate is running, the active

sheet
is no longer the one being deactivated, so I have to select it back

again,
making it the active sheet, and put in place a set of boolean

variables,
to
know if this action is taking place before deactivating the sheet, or

under a
regular activation.

Any suggestions?






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
Protect Workbook vs Worksheet?? Dan B Excel Worksheet Functions 3 November 7th 05 09:02 PM
Inserting Filtered RC cell information into other worksheets Dennis Excel Discussion (Misc queries) 10 July 30th 05 01:54 AM
Search/Match between 2 x separate Worksheets and populate result in third worksheet Alan Bartley Excel Discussion (Misc queries) 1 April 11th 05 05:21 AM
Weekly Transaction Processing Ralph Howarth Excel Worksheet Functions 4 January 19th 05 05:37 AM
copyright and worksheet protection dow Excel Discussion (Misc queries) 2 January 3rd 05 03:07 PM


All times are GMT +1. The time now is 04:24 PM.

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

About Us

"It's about Microsoft Excel"