Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
validate cells
In Excel, how can I validate that a cell has data? If there are blank cells,
I would like a message box when the user clicks on file to save or send. Any help would be greatly appreciated. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
validate cells
You can use the Workbook_BeforeSave event.
In this event you put something like this if Sheet1.Cells(1,1).Value = "" then Cancel=True Endif "Tammy H" wrote: In Excel, how can I validate that a cell has data? If there are blank cells, I would like a message box when the user clicks on file to save or send. Any help would be greatly appreciated. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
validate cells
If IsEmpty(Sheet1.Cells(1,1)) then ...
Alok wrote: You can use the Workbook_BeforeSave event. In this event you put something like this if Sheet1.Cells(1,1).Value = "" then Cancel=True Endif "Tammy H" wrote: In Excel, how can I validate that a cell has data? If there are blank cells, I would like a message box when the user clicks on file to save or send. Any help would be greatly appreciated. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
validate cells
Private Sub Workbook_BeforeClose(Cancel As Boolean)
If Application.CountBlank(worksheets("Sheet1") _ .Range("A1:Z26")) 0 then msgbox "Blank Cells Exist" Cancel:=True end if End Sub Make the workbook a window, then right click on the blue border at the top and select view code. this is the ThisWorkbook module. Put in code like the above. However, What if the user is trying to close without saving? Anyway, change the sheet name and the specified range to be what you want to check. http://www.cpearson.com/excel/events.htm has general information on events - Chip Pearson's site. -- Regards, Tom Ogilvy "Tammy H" <Tammy wrote in message ... In Excel, how can I validate that a cell has data? If there are blank cells, I would like a message box when the user clicks on file to save or send. Any help would be greatly appreciated. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Trying to validate input based upon values in two other cells | Excel Discussion (Misc queries) | |||
validate multiple cells in to one dropdown box | Excel Discussion (Misc queries) | |||
HOW DO I GET EXCEL TO VALIDATE TWO CELLS AT ONCE | Excel Discussion (Misc queries) | |||
Validate cells have data | Excel Worksheet Functions | |||
Validate Cells based on if conditions | Excel Programming |