Hello wise ones,
I am writing code to have VBA check a numeric total in a specific cell in one spreadsheet with a total in a cell in another spreadsheet. The code works to execute the comparison, but after the comparison I want to bring up a message box if the numbers are different to alert me of that condition. If the numbers are the same (FALSE condition in my code), I want to exit the IF and continue on in the procedure to check other numbers. I know you can use Exit For in a For loop, but I have never done an IF statement without an ELSE so I am not sure how it is done. I tried Else: End, but that shuts down the procedure completely. Help please?
I am writing code to have VBA check a numeric total in a specific cell in one spreadsheet with a total in a cell in another spreadsheet. The code works to execute the comparison, but after the comparison I want to bring up a message box if the numbers are different to alert me of that condition. If the numbers are the same (FALSE condition in my code), I want to exit the IF and continue on in the procedure to check other numbers. I know you can use Exit For in a For loop, but I have never done an IF statement without an ELSE so I am not sure how it is done. I tried Else: End, but that shuts down the procedure completely. Help please?
VBA Code:
If Overview800Ttl <> Breakdown800Ttl Then]
MsgBox ("The 800 totals don't match. Investigation needed.")
Else: End
End If