I know this could probably be more efficient, but in essence, I need to check columns G, J, M, P, and S to ensure there is at least the one check mark. If not, I don't want the procedure to continue. All five columns must have at least the one check mark. The column to one to the left establishes the last row of the range to check.
Code: Select all
Sub CheckColumns()
Dim ColG As Long
Dim ColJ As Long
Dim ColM As Long
Dim ColP As Long
Dim ColS As Long
With Sheets("Dashboard")
ColG = WorksheetFunction.CountIf(.Range("G2:G" & .Cells(.Rows.Count, "F").End(xlUp).Row), "a")
ColJ = WorksheetFunction.CountIf(.Range("J2:J" & .Cells(.Rows.Count, "I").End(xlUp).Row), "a")
ColM = WorksheetFunction.CountIf(.Range("M2:M" & .Cells(.Rows.Count, "L").End(xlUp).Row), "a")
ColP = WorksheetFunction.CountIf(.Range("P2:P" & .Cells(.Rows.Count, "O").End(xlUp).Row), "a")
ColS = WorksheetFunction.CountIf(.Range("S2:S" & .Cells(.Rows.Count, "R").End(xlUp).Row), "a")
End With
MsgBox ColG + ColJ + ColM + ColP + ColS
End Sub