Hi,
I am new to VBA and stumbling along, came across my latest issue. I have the following code:
It works fine except when I come to hidden rows. It returns the location of the hidden row as well subject to the criteria above... How can I change my code so that it looks at visible cells only??
I am new to VBA and stumbling along, came across my latest issue. I have the following code:
Code:
Sub find()
Dim nCol As String
Dim nRow As String
Range("a1").Select
Const Light_Yellow = 36
With Sheets("Sheet1")
For Each c In .Range("a1:a10")
If c.Interior.ColorIndex = Light_Yellow Then
nCol = c.Column
nRow = c.Row
Result = msgbox("The cell is at col " & nCol & " and row " & nRow, , "It Works!!")
Else
End If
Next
End With
End Sub
It works fine except when I come to hidden rows. It returns the location of the hidden row as well subject to the criteria above... How can I change my code so that it looks at visible cells only??