I have a spreadsheet that is filtered and I need to compare values of two columns, if they are all same in visible filtrated cells then macro a executes, and if any of them is different then macro b executes.
I already tried to define ranges as:
Set rng1 = Range("X:X").Cells.SpecialCells(xlCellTypeVisible)
Set rng2 = Range("AU:AU").Cells.SpecialCells(xlCellTypeVisible)
and define values of the first visible range
valE = ActiveSheet.Range("X:X").Cells.SpecialCells(xlCellTypeVisible).Value
valX = ActiveSheet.Range("AU:AU").Cells.SpecialCells(xlCellTypeVisible).Value
I don't know how to write a loop that iterates through specified range comparing next visible rows. What should I refer to?