I have written code so that if the cell content if is equal content is equal to a set variable, then the macros counts it as a value of one (this works great), I need to add code, so that if the cell content is not blank, or not equal to the previous variables it will also count as one , I am having trouble with the "not equal to" statement
it is this last line of code that is not working for me
I am getting error code 13 mismatch. any help is much appreciated.
Code:
If Cells(DateIndex - k, j + 1) = "0" And Cells(5, j + 1).Value = "HIGH" Then
Condition1 = Condition1 1
ElseIf Cells(DateIndex - k, j + 1) = "Z" Then
Condition2= Condition2 + 1
ElseIf Cells(DateIndex - k, j + 1) = "Y" Then
Condition3 = Condition3 + 1
ElseIf Cells(DateIndex - k, j + 1) = "X" Then
Condition4 = Condition4 + 1
ElseIf Cells(DateIndex - k, j + 1) = "W" Then
Condition5 = Condition5 + 1
ElseIf Cells(DateIndex - k, j + 1) = "V" Then
Condition6 = Condition6 + 1
ElseIf Cells(DateIndex - k, j + 1) <> "Z" And "Y" And "X" And "W" And "V" And "0" Then
OtherRead= OtherRead + 1
Code:
ElseIf Cells(DateIndex - k, j + 1) <> "A" And "B" And "C" And "D" And "E" And "0" Then
OtherRead= OtherRead + 1
Last edited: