ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Reference the next visible cell (https://www.excelbanter.com/excel-programming/378171-reference-next-visible-cell.html)

Otto Moehrbach

Reference the next visible cell
 
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



Ron de Bruin

Reference the next visible cell
 
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).Selec t
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Otto Moehrbach" wrote in message ...
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



Otto Moehrbach

Reference the next visible cell
 
Thanks Ron. I'll give that a try in the morning. Otto
"Ron de Bruin" wrote in message
...
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).Selec t
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Otto Moehrbach" wrote in message
...
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




Shlomit

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

Thanks a lot
shlomit

"Otto Moehrbach" wrote:

Thanks Ron. I'll give that a try in the morning. Otto
"Ron de Bruin" wrote in message
...
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).Selec t
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Otto Moehrbach" wrote in message
...
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






All times are GMT +1. The time now is 12:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com