LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 143
Default Making a field compulsary before user leaves sheet

Put the following in the worksheet code area:

Private Sub Worksheet_Deactivate()
Dim checkRng As Range
Set checkRng = Sheets("Sheet1").Range("A1")
If checkRng.Value = "" Then
Sheets("Sheet1").Activate
MsgBox "Please fill in " & _
checkRng.Address(False, False) & "."
End If
End Sub

Hopefully this has not been truncated.
 
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
Error Message if user leaves a field blank GillianX Excel Worksheet Functions 1 October 14th 08 05:40 PM
PivotTable with Server Page Field Leaves MS Query Application WindowOpen After Refresh. Dave[_63_] Excel Programming 0 December 3rd 07 12:38 AM
Cancel of text box leaves sheet unprotected Steve_n_KC Excel Worksheet Functions 2 May 24th 07 07:25 PM
I need to auto exit MS Excel when user leaves workbook open over . Jacques Excel Programming 2 February 18th 05 07:13 AM
Making cells compulsary to fill in on a worksheet abfabrob Excel Discussion (Misc queries) 7 February 4th 05 12:20 AM


All times are GMT +1. The time now is 04:47 AM.

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"