I have a macro where I select files to open then my macro runs on each file.
It checks cells within a range for the correct data I have everything working except a small part of the code.
If Range("D1").Formula <> "=Latest!C5" Then
ElseIf Range("D1").Formula <> "=Latest!B5" Then
MsgBox "Cell D1 formula is incorrect."
End If
Now it checks the cell in each worksheet but for some reason says the formula is incorrect for cells containing the =Latest!B5 formula, but if I swap the formula's places in the if elsif, then all the worksheets with the =Latest!C5 formula say they are incorrect.
It checks cells within a range for the correct data I have everything working except a small part of the code.
If Range("D1").Formula <> "=Latest!C5" Then
ElseIf Range("D1").Formula <> "=Latest!B5" Then
MsgBox "Cell D1 formula is incorrect."
End If
Now it checks the cell in each worksheet but for some reason says the formula is incorrect for cells containing the =Latest!B5 formula, but if I swap the formula's places in the if elsif, then all the worksheets with the =Latest!C5 formula say they are incorrect.