Popup Error Messages For incompleet Sheet

stokie21

Board Regular
Joined
Dec 31, 2008
Messages
95
Hi Guys, Is there a way I can make an error message popup if cells are left empty.

As an example Say cell A2 needed a name to be entered and it was missed, as i press the save button can i have a message that says " you have not filled in cell A2 " ect ect

I have made a sheet and staff are missing silly things like yes no answers!!

Thanks
 
Do you understand what < 19 is doing? That should be the correct number of cells.
 
Upvote 0

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
its working fine now, But it needs a tweek!!

I have entered all the info that i want,and checked the numbers match the cells and they do. The sheet is still saying to enter all info,here are the correct cells and code:

Code:
 Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If WorksheetFunction.CountA(Range("C11,H11,C13,H14,C16,C18,C20,D23,D25,I25,C27,F27,D29,I33")) < 19 Then
    Cancel = True
    MsgBox "You must complete all fields", vbExclamation, "NOT SAVED"
End If
End Sub



2nd problem say i open the sheet by mistake, as its on my desktop the sheet will not just close it says i need to enter the info!
I know thats its job but it needs a tweek!!

Can we tweek the code so that it will kick in as soon as something is entered in cell C11 ? if nothing is entered then the rule will not apply?


I am almost there, Problem 2 Still stands Any idea how to fix this?
 
Upvote 0
Rich (BB code):
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If Sheets("Sheet1").Range("C11").Value <> "" And WorksheetFunction.CountA(Sheets("Sheet1").Range("H11,C13,C16,C18,D23,I25,C27,D29")) < 8 Then
    Cancel = True
    MsgBox "You must complete all fields", vbExclamation, "NOT SAVED"
End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,569
Messages
6,179,605
Members
452,928
Latest member
VinceG

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top