I have a macro that selects the next unique value in a column, however there are hidden rows and it is also selecting cells that are hidden. How do I change the range to only active cells/rows?
Sub NextUnique()
' NextUnique Macro
Dim i As Integer
i = 0
Do
i = i + 1
If Cells(ActiveCell.Row + i, ActiveCell.Column).Value <> ActiveCell.Value Then
Cells(ActiveCell.Row + i, ActiveCell.Column).Select
Exit Do
End If
Loop
End Sub
Sub NextUnique()
' NextUnique Macro
Dim i As Integer
i = 0
Do
i = i + 1
If Cells(ActiveCell.Row + i, ActiveCell.Column).Value <> ActiveCell.Value Then
Cells(ActiveCell.Row + i, ActiveCell.Column).Select
Exit Do
End If
Loop
End Sub