A
Anders
Hi All,
I have this sub (below) working if I change the
..cells(i) to cells(i).Interior.ColorIndex = 3
but I don't want to color it red if <>, I want to hide it. cells(i).hidden
= true doesn't work.
Any help is greatly appreciated!
TIA,
Anders
Sub Compare2Shts()
Dim rRangePrimary As Range
Dim rRangeSecondary As Range
Dim strPrompt As String
Set rRangePrimary = Range("g1:h536")
Set rRangeSecondary = Range("q1:r536")
With rRangeSecondary
For i = 1 To .Rows.Count
If .Cells(i).Value <> rRangePrimary.Cells(i).Value Then
..Cells(i).Hidden = True
End If
Next i
End With
End Sub
I have this sub (below) working if I change the
..cells(i) to cells(i).Interior.ColorIndex = 3
but I don't want to color it red if <>, I want to hide it. cells(i).hidden
= true doesn't work.
Any help is greatly appreciated!
TIA,
Anders
Sub Compare2Shts()
Dim rRangePrimary As Range
Dim rRangeSecondary As Range
Dim strPrompt As String
Set rRangePrimary = Range("g1:h536")
Set rRangeSecondary = Range("q1:r536")
With rRangeSecondary
For i = 1 To .Rows.Count
If .Cells(i).Value <> rRangePrimary.Cells(i).Value Then
..Cells(i).Hidden = True
End If
Next i
End With
End Sub