Thank you all for the information (Sorry for spelling errors in advance). I did figure out the issue myself. I also concatenated the msgbox to contain all of the errors at once. I created the following code to cover three scenarios:
1. Will save if all fields are null
2. Will not save if one or more of the required fields are null
3. Will save if all fields required are completed.
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If IsEmpty(ThisWorkbook.Sheets(1).Range("B6")) Then
MsgBox ("Must enter Supplier Name")
Cancel = True
Else
If IsEmpty(ThisWorkbook.Sheets(1).Range("C6")) Then
MsgBox ("Must enter Supplier Location")
Cancel = True
Else
If IsEmpty(ThisWorkbook.Sheets(1).Range("D6")) Then
MsgBox ("Please enter your 5 digit supplier code. If you need assistance with the supplier code please contact SSG at 1(800)782-8099")
Cancel = True
Else
If IsEmpty(ThisWorkbook.Sheets(1).Range("B10")) Then
MsgBox ("Please enter expected users First name")
Cancel = True
Else
If IsEmpty(ThisWorkbook.Sheets(1).Range("C10")) Then
MsgBox ("Please enter expected users Last name")
Cancel = True
Else
If IsEmpty(ThisWorkbook.Sheets(1).Range("D10")) Then
MsgBox ("Please Create an original SSO # for this user")
Cancel = True
Else
If IsEmpty(ThisWorkbook.Sheets(1).Range("F10")) Then
MsgBox ("Please enter expected users email address. Note: This must be a complete and existing email address")
Cancel = True
Else
If IsEmpty(ThisWorkbook.Sheets(1).Range("G10")) Then
MsgBox ("Please enter expected users full phone number with area code")
Cancel = True
End If
End If
End If
End If
End If
End If
End If
End If
End Sub
Bookmarks