Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
How do I prevent saving an excel file if cells are blank?
|
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hi Leighann
You can use the before save event Copy this event in the Thisworkbook module Change the sheet name and ranges in this line Set myrange = Worksheets("Sheet1").Range("A1:A6,C10,D12,G1:G3") Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) Dim myrange As Range Set myrange = Worksheets("Sheet1").Range("A1:A6,C10,D12,G1:G3") If Application.WorksheetFunction.CountA(myrange) < _ myrange.Cells.Count Then MsgBox "fill in all cells" Cancel = True End If End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "Leighann" wrote in message ... How do I prevent saving an excel file if cells are blank? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel file not saving properly | Excel Discussion (Misc queries) | |||
how to remove blank cells in excel | Excel Discussion (Misc queries) | |||
importing a particular excel worksheet into another excel file | Excel Worksheet Functions | |||
Excel Outlook Attachments opening after several errors everytime | Setting up and Configuration of Excel | |||
saving excel file as tab delimited | Excel Discussion (Misc queries) |