I have the following code which is intended to check the contents of 4 cells and if any of them is blank it displays an error message which is different depending on which cell is empty.
If all 4 cells are completed then the macro prints the page.
I have never combined more than one if statement and don't know how to, guessing there is some sor t of OR command.
Thanks in advance
David
If ActiveSheet.Range("B8") = "" Then
MsgBox ("Please enter your name")
If ActiveSheet.Range("B9") = "" Then
MsgBox ("Please enter the contract you work on, or enter n/a if central function")
If ActiveSheet.Range("I8") = "" Then
MsgBox ("Please enter your permanent base site")
If ActiveSheet.Range("B8") = "" Then
MsgBox ("Please enter your accounting unit code e.g. 31413260 which is available from your site accountant")
End
Else:
Application.ScreenUpdating = False
Sheets("Claim Form").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=2
Application.ScreenUpdating = True
End If
End Sub
If all 4 cells are completed then the macro prints the page.
I have never combined more than one if statement and don't know how to, guessing there is some sor t of OR command.
Thanks in advance
David
If ActiveSheet.Range("B8") = "" Then
MsgBox ("Please enter your name")
If ActiveSheet.Range("B9") = "" Then
MsgBox ("Please enter the contract you work on, or enter n/a if central function")
If ActiveSheet.Range("I8") = "" Then
MsgBox ("Please enter your permanent base site")
If ActiveSheet.Range("B8") = "" Then
MsgBox ("Please enter your accounting unit code e.g. 31413260 which is available from your site accountant")
End
Else:
Application.ScreenUpdating = False
Sheets("Claim Form").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=2
Application.ScreenUpdating = True
End If
End Sub