Hello,
Suppose we are comparing Columns A and C. I want values of cells in Column A highlighted if not matching the corresponding value in Column C. I am thinking something like this:
Sub highlight_cells_if_not_matching ()
Dim i as Integer
Dim j as integer
Dim nr as integer
nr=selection.rows.count
For i =nr to 1 step -1
if selection.cells(i,j).value<>selection.cells.offset (i, j+2).value Then ' this is where I have problem, I am also thinking of using smth like [isna.worksheet.function(match (
selecion.cells(i, j).interior.color=vbcyan
end if
i=i+1
Next
End sub
Could someone please help me fixing this code.
Thank you,
Shawn
Suppose we are comparing Columns A and C. I want values of cells in Column A highlighted if not matching the corresponding value in Column C. I am thinking something like this:
Sub highlight_cells_if_not_matching ()
Dim i as Integer
Dim j as integer
Dim nr as integer
nr=selection.rows.count
For i =nr to 1 step -1
if selection.cells(i,j).value<>selection.cells.offset (i, j+2).value Then ' this is where I have problem, I am also thinking of using smth like [isna.worksheet.function(match (
selecion.cells(i, j).interior.color=vbcyan
end if
i=i+1
Next
End sub
Could someone please help me fixing this code.
Thank you,
Shawn