Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I found the following code snippet that will not allow a user to save a
worksheet until cell M2 has been populated: Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) If IsEmpty(Sheets("Sheet1").Range("M2").Value) Then Cancel = True MsgBox ("The workbook cannot be saved until cell M2 has been populated.") End If End Sub Being relatively new to VBA, can someone tell me how to modify the code above so that a range (M2:M25) must be populated before a user is allowed to save the worksheet? I tried changing the 2nd code line above to: If IsEmpty(Sheets("Sheet1").Range("M2:M25").Value) Then but that didn't work. Any help would be greatly appreciated. Thanks, Bob |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Multiple question requiring asistance please | Excel Worksheet Functions | |||
Requiring Cell Content on Save | Excel Discussion (Misc queries) | |||
Requiring data in certain cells | Excel Worksheet Functions | |||
Control + Shift + Up/Down not allowing me to select multiple cells. | Excel Discussion (Misc queries) | |||
Macro for Not Allowing to Save without first completing fields | Excel Discussion (Misc queries) |