Reference the next visible cell

O

Otto Moehrbach

Excel XP & Win XP
I have a variable number of columns after Column B hidden. With the active
cell, B4, how can I reference the next visible cell in row 4?
Thanks for your time. Otto
 
R

Ron de Bruin

You can try this Otto with the cell in B active

Sub test()
Dim rng As Range
Set rng = Range(Cells(ActiveCell.Row, ActiveCell.Column + 1), Cells(ActiveCell.Row, Columns.Count))
rng.SpecialCells(xlCellTypeVisible).Cells(1).Select
End Sub
 
G

Guest

Hi, It's ok.
I found the answer
" For Each cell In myRng" each cell return the correct row number.

Thanks a lot
shlomit
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top