LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 97
Default Workbook_BeforeClose trouble

Hi All,

I am having real trouble with 'Workbook_BeforeClose'. I have read numerous
threads and the help in VB, but nothing I try makes the event work. I am now
so confused I'm stumped.

Can someone give me a step by step guide to what I need to do for this to
work please? I basically want to select a particular sheet in the workbook
before closing it. This sheet will always be in the same position in the
workbook, but will have a different name every time.

I have tried this code to no avail:

Private Sub Workbook_BeforeClose( )
Sheets(3).Select 'select required sheet
ActiveWorkbook.Close 'close on required sheet
End Sub
 
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
Workbook_BeforeClose? kartune85[_11_] Excel Programming 6 June 26th 06 08:53 AM
Workbook_BeforeClose Alan McQuaid via OfficeKB.com Excel Programming 3 June 13th 06 04:36 PM
workbook_beforeClose GB Excel Programming 2 March 1st 06 12:39 AM
Workbook_BeforeClose Andrzej Excel Programming 1 June 12th 05 10:01 PM
Workbook_BeforeClose PO Excel Programming 2 January 30th 05 05:07 PM


All times are GMT +1. The time now is 02:43 AM.

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"