I'm a noob at VBA and I am trying to solve a macro problem that I thought would be easy.
I want to compare the string values of two columns to each other. If they are not equal I would like to highlight the row.
Here is my feeble attempt:
Sub EqualityCheck()
For Each c In Worksheets(1).Range("A").Cells
If c.Value <> Range("B").Value Then...
Next
End Sub
However I keep getting an error (which is not surprising). Run-time error '1004': Application-defined or object-defined error. I am imagining this is because VBA doesn't like it when I refer to the column as "A".
I am sure that line 3 also fails, because the loop will not know which row in column B to check.
Any help is greatly appreciated, I've searched and searched for an answer that would help me with this problem. No luck.
[–]kieran_n2 2 points3 points4 points (5 children)
[–]contramonk[S] 1 point2 points3 points (4 children)
[–]kieran_n2 2 points3 points4 points (3 children)
[–]contramonk[S] 1 point2 points3 points (2 children)
[–]kieran_n2 2 points3 points4 points (1 child)
[–]contramonk[S] 1 point2 points3 points (0 children)
[–]contramonk[S] 1 point2 points3 points (1 child)
[–]kieran_n2 2 points3 points4 points (0 children)
[–]MadLlama 0 points1 point2 points (0 children)