Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 469
Default open & close event

not having done this befor. use open event to start then in same workbook
code window can you put an close event sub. thinking that close will run on
all worksheets in workbook when closed? posed the question as am not good at
this. am expermitting only looking to find if I am going right way.
Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default open & close event

Curt,
Is this what you mean ?

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim WS As Worksheet

For Each WS In ThisWorkbook.Worksheets
With WS
'do something
End With
Next

End Sub

NickHK

"Curt" wrote in message
...
not having done this befor. use open event to start then in same workbook
code window can you put an close event sub. thinking that close will run

on
all worksheets in workbook when closed? posed the question as am not good

at
this. am expermitting only looking to find if I am going right way.
Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 469
Default open & close event

Thank You

"NickHK" wrote:

Curt,
Is this what you mean ?

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim WS As Worksheet

For Each WS In ThisWorkbook.Worksheets
With WS
'do something
End With
Next

End Sub

NickHK

"Curt" wrote in message
...
not having done this befor. use open event to start then in same workbook
code window can you put an close event sub. thinking that close will run

on
all worksheets in workbook when closed? posed the question as am not good

at
this. am expermitting only looking to find if I am going right way.
Thanks




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
Don't save before close event? Don Wiss Excel Programming 1 September 18th 04 01:51 AM
Open/Close Event and Excel Saving process Hari[_3_] Excel Programming 2 September 10th 04 03:16 PM
user form-on open event? keydown event? FSt1[_3_] Excel Programming 2 August 5th 04 02:26 PM
VBA - on a button event, open another closed file, post changes, close file Fio Excel Programming 0 March 1st 04 01:08 PM
After Close Event? Don Wiss Excel Programming 2 November 19th 03 12:30 AM


All times are GMT +1. The time now is 11:27 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"