LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 68
Default workbook before close

I have folowing code

Private Sub Workbook_BeforeClose(Cancel As Boolean)

If Range("G2").Value = "UNBALANCED!" Then Response = MsgBox("ATTENTION
UNBALANCED! Yes to go ahead / No to Cancel and correct.", vbYesNo)

If Rensponse = vbNo Then Exit Sub
If Response = vbYes Then

End if
End Sub

What I want to achieve is: when pressed "No" to go back to sheet, to
stop closing procedure
When pressed "Yes" close workbook

Is this possible?

Cheers,
Harold
 
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
close a workbook after 5 minutes Marilyn Excel Discussion (Misc queries) 15 September 18th 08 08:44 PM
Close personal projekt workbook alvin Kuiper Excel Discussion (Misc queries) 1 November 5th 07 12:55 PM
run macro on workbook close Nigel Excel Discussion (Misc queries) 3 November 29th 05 08:48 PM
close only one workbook bobsmom70601 New Users to Excel 1 March 8th 05 09:43 PM
How can I close only 1 workbook when I have many open? jpt consulting Excel Discussion (Misc queries) 3 November 30th 04 11:58 PM


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