LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
swisse
 
Posts: n/a
Default

Make a macro in the Workbook_BeforeClose(), which checks if the user put some
data in cell A1. If none it puts a messagebox on the screen then it cancels
the closure of the workbook, until the user has put some data in A1. Here is
the code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
If IsEmpty(Range("A1")) Then
MsgBox "Please enter data in A1."
Cancel = True
End If
End Sub

Swisse
 
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
Avoid user having to enter hours when using [mm]:ss format Lady_luck Excel Discussion (Misc queries) 3 January 4th 05 10:50 AM
Avoid user having to enter 00 hours when using [mm]:ss format Lady Luck Excel Discussion (Misc queries) 4 January 2nd 05 06:56 PM
INDEX, user input? chris w Excel Worksheet Functions 3 December 10th 04 06:07 PM


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