I am trying to create macro to find specific text "Prior Month Premium" and then check cell to the right to see if left empty and if so then Msgbox the user to enter missing info. Here's what I got so far which is specific to certain cells being populated...
Code
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If (Sheets("Statement").Range("h84").Value = "") Then
MsgBox "Please enter a Prior Month Premium"
Cancel = True
End If
Dim c As Range
For Each c In Sheets("Statement").Range("j86")
If Not IsEmpty(c) And (Sheets("Statement").Range("j86") = "adjustment") Then
If (Sheets("Statement").Range("c82") = "") Then
MsgBox "Please explain the difference between prior and current month premiums before saving." & Chr(13)
Cancel = True
End If
End If
Next c
End Sub
Display More