Hi all,
I need some help here.
I need an error msg to prompt out and prevent user from saving the file two particular cells are not filled in when another one has an specific value.
Meaning if cell N15 is filled up with "Weight" value, Cells T15 & U15 will have to be filled up before the user can save the file. So far I have the following two rules that I couldn't compile in one.
If Sheets("Service Schedule").Range("N15").Value = "Weight" And Sheets("Service Schedule").Range("T15").Value = "" Then
MsgBox "You must have a value in Service Schedule Price Per Tn. File was not saved."
Cancel = True
End If
If Sheets("Service Schedule").Range("N15").Value = "Weight" And Sheets("Service Schedule").Range("U15").Value = "" Then
MsgBox "You must have a value in Service Schedule Price Per Tn. File was not saved."
Cancel = True
End If
The same applies when cell N16 is filled up with same value, in this case requiring cells T16 & U16 to be filled in. This goes on for circa 100 lines.
I've done it individually as above but the programme is too long and VBD cannot compile it.
Thank you in advance!
Dieguete
I need some help here.
I need an error msg to prompt out and prevent user from saving the file two particular cells are not filled in when another one has an specific value.
Meaning if cell N15 is filled up with "Weight" value, Cells T15 & U15 will have to be filled up before the user can save the file. So far I have the following two rules that I couldn't compile in one.
If Sheets("Service Schedule").Range("N15").Value = "Weight" And Sheets("Service Schedule").Range("T15").Value = "" Then
MsgBox "You must have a value in Service Schedule Price Per Tn. File was not saved."
Cancel = True
End If
If Sheets("Service Schedule").Range("N15").Value = "Weight" And Sheets("Service Schedule").Range("U15").Value = "" Then
MsgBox "You must have a value in Service Schedule Price Per Tn. File was not saved."
Cancel = True
End If
The same applies when cell N16 is filled up with same value, in this case requiring cells T16 & U16 to be filled in. This goes on for circa 100 lines.
I've done it individually as above but the programme is too long and VBD cannot compile it.
Thank you in advance!
Dieguete