G
Guest
I am trying to access the next cell in a Range of SpecialCells of xlVisible
type only. For some reason when I use
Dim r as Range, rng1 as range
set rng1 = colums(3).SpecialCells(xlVisible)
For each r in rng1
blah,blah
Next
It goes through the visible cells. BUT when I replace the For Each loop with
rng1.Cells(2,1).Value
rng1.Cells(3,1).Value
where cells(3,1,) in the normal worksheet is hidden, it will return the
hidden cell(the hidden cell right after the non-hidden cell cells(2,1)
instead of returning the next visible cell in the rng1 object.
Any ideas? I want to compare the contents of two visible cells to see if
they are duplicates, and delete the second cell and the hidden cells after
the duplicate.
type only. For some reason when I use
Dim r as Range, rng1 as range
set rng1 = colums(3).SpecialCells(xlVisible)
For each r in rng1
blah,blah
Next
It goes through the visible cells. BUT when I replace the For Each loop with
rng1.Cells(2,1).Value
rng1.Cells(3,1).Value
where cells(3,1,) in the normal worksheet is hidden, it will return the
hidden cell(the hidden cell right after the non-hidden cell cells(2,1)
instead of returning the next visible cell in the rng1 object.
Any ideas? I want to compare the contents of two visible cells to see if
they are duplicates, and delete the second cell and the hidden cells after
the duplicate.