Hello I've created the below Macro in order to check that if column A is populated then column C must also be populated. However, I am only able to do that for a single row.
How can I enhance this macro so that excel will check all the instances where a row in Column A is populated and check against Column C to ensure that is also a populated cell? I assume I need a for loop, but haven't come across a thread that targets my specific issue. Thanks in Advance!
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If Range("A2").Value <> "" And Range("C2") = "" Then
Cancel = True
MsgBox "Save cancelled"
End If
End Sub
How can I enhance this macro so that excel will check all the instances where a row in Column A is populated and check against Column C to ensure that is also a populated cell? I assume I need a for loop, but haven't come across a thread that targets my specific issue. Thanks in Advance!
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If Range("A2").Value <> "" And Range("C2") = "" Then
Cancel = True
MsgBox "Save cancelled"
End If
End Sub