ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Goto Next VISIBLE cell below (https://www.excelbanter.com/excel-programming/299208-goto-next-visible-cell-below.html)

Rasmus[_2_]

Goto Next VISIBLE cell below
 
Current activecell is A13 and I'm using autofilter. What the VBA command to
go to the next VISIBLE cell below - i.e. A21 ?

Regards,
Rasmus



Chip Pearson

Goto Next VISIBLE cell below
 
Rasmus,

I think you'd need to loop downwards, checking the Hidden
property of the row.

Dim Rng As Range
Set Rng = ActiveCell
Do
Set Rng = Rng(2, 1)
Loop Until Rng.EntireRow.Hidden = False


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"Rasmus" wrote in message
t.cable.rogers.com...
Current activecell is A13 and I'm using autofilter. What the

VBA command to
go to the next VISIBLE cell below - i.e. A21 ?

Regards,
Rasmus





cucchiaino

Goto Next VISIBLE cell below
 
Rasmus wrote:
Current activecell is A13 and I'm using autofilter. What the VBA
command to go to the next VISIBLE cell below - i.e. A21 ?


Hi, Rasmus.

Try this

......
ActiveCell.Offset(1, 0).Activate
Do While ActiveCell.EntireRow.Hidden = True
ActiveCell.Offset(1, 0).Activate
Loop
......




Tom Ogilvy

Goto Next VISIBLE cell below
 
Dim rng as Range
set rng = Range("A13")
do
set rng = rng.offset(1,0)
Loop while rng.entireRow.Hidden = True
rng.Select



--
Regards,
Tom Ogilvy

"Rasmus" wrote in message
t.cable.rogers.com...
Current activecell is A13 and I'm using autofilter. What the VBA command

to
go to the next VISIBLE cell below - i.e. A21 ?

Regards,
Rasmus





Soo Cheon Jheong

Goto Next VISIBLE cell below
 
Try this:

Dim rng As Range
Dim i As Long
For Each rng In Range(ActiveCell, Cells(Rows.Count,
ActiveCell.Column)).SpecialCells(Type:=12, Value:=23)
If i 0 Then
rng.Select
Exit For
End If
i = i + 1
Next

--
Soo Cheon Jheong
http://excel.hompy.com



Tom Ogilvy

Goto Next VISIBLE cell below
 
why not just

Range(ActiveCell.Offset(1,0), _
Cells(Rows.Count,ActiveCell.Column)). _
SpecialCells(Type:=12, Value:=23)(1).Select

Add error checking of course

--
Regards,
Tom Ogilvy


"Soo Cheon Jheong" wrote in message
...
Try this:

Dim rng As Range
Dim i As Long
For Each rng In Range(ActiveCell, Cells(Rows.Count,
ActiveCell.Column)).SpecialCells(Type:=12, Value:=23)
If i 0 Then
rng.Select
Exit For
End If
i = i + 1
Next

--
Soo Cheon Jheong
http://excel.hompy.com






All times are GMT +1. The time now is 04:52 AM.

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