Hi Brian
This code will select the fifth cell in the firts row of the visible cells.
ActiveSheet.UsedRange.SpecialCells(xlVisible).Rows(1).Cells(1, 5).Select
Dave
OzGrid Business Applications
Dave
I filled in a range of about 10 by 10 and hid column c. I then tried the code (which seems like it should work) - but it landed in column E - the 5th column even though column C was hidden. I won't know how many columns are hidden so I need it to land on the 5th visible column which would be F.
Any additional thoughts?
Thanks very much
I filled in a range of about 10 by 10 and hid column c. I then tried the code (which seems like it should work) - but it landed in column E - the 5th column even though column C was hidden. I won't know how many columns are hidden so I need it to land on the 5th visible column which would be F. Any additional thoughts?
Hi Brian
As I'm not too sure waht your criteria is for selecting the cell, this code will select the first visible cell in row 1 after the first hidden column
Sub InstallAddIn()
Dim RvisCells As Range
Dim RMyCell As Range
Set RvisCells = Rows(1).SpecialCells(xlVisible)
For Each RMyCell In RvisCells
If RMyCell.Column <> 1 Then
If RMyCell.Offset(0, -1).EntireColumn.Hidden = True Then
RMyCell.Select
Exit For
End If
End If
Next RMyCell
End Sub
Dave