Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I probaly meant before save. Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) If Not IsDate(Sheets("Sheet1").Range("A1")) _ Or IsEmpty(Sheets("Sheet1").Range("A2")) Then MsgBox "Some sort of dire warning" Cancel = True End If End Sub Mike "Mike H" wrote: Hi, Alt+F11 to open VB editor. Double click 'This workbook' and paste this in on the right . Change ranges and sheet to suit Private Sub Workbook_BeforeClose(Cancel As Boolean) If Not IsDate(Sheets("Sheet1").Range("A1")) _ Or IsEmpty(Sheets("Sheet1").Range("A2")) Then MsgBox "Some sort of dire warning" Cancel = True End If End Sub Mike "cmac" wrote: Is there a way to require that a particular cell be populated prior to saving an Excel file (one cell is text and one is a date field)? We are using a spreadsheet to collect data from users that is later used to feed an Access database and need to be sure that the source file has these two key cells populated. Thank you - |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Conditional Formatting based on data in adjacent cell & restrict save without required data | Excel Programming | |||
How do I work on data starting to a cell a cell with a required va | Excel Programming | |||
Removing lines of data that do not contain required data (macro) | Excel Programming | |||
Cell data required upon close | Excel Programming | |||
Change Cell Data of a Required Column | Excel Programming |