"IF" handling

flyinghigher2014

New member
Joined
May 12, 2016
Messages
13
Reaction score
0
Points
0
hi all

i want cells to be checked to see make sure data has been entered in them before file is saved to pdf, this part of the code sort of does that but it just shows a popup message then opens the save dialog box. could someone please tell me where im going wrong in this part of the code please.
Code:
If Range("N13") = "" ThenMsgBox "Please Enter The Invoice Date"




ElseIf Range("N16") = "" Then
MsgBox "Please Enter The Start Date For Your Contract Hire"




ElseIf Range("N17") = "" Then
MsgBox "Please Enter The End Date For Your Contract Hire"




ElseIf Range("G12") = "" Then
MsgBox "Please add the company"
Exit Sub


End If

many thanks in advance
 
Na bother ive just seen where i went wrong, it should have been

Code:
If Range("N13") = "" ThenMsgBox "Please Enter The Invoice Date"
Exit Sub


ElseIf Range("N16") = "" Then
MsgBox "Please Enter The Start Date For Your Contract Hire"
Exit Sub


ElseIf Range("N17") = "" Then
MsgBox "Please Enter The End Date For Your Contract Hire"
Exit Sub


ElseIf Range("G12") = "" Then
MsgBox "Please add the company"
Exit Sub


End If
 
Back
Top