Goto Next VISIBLE cell below

R

Rasmus

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
 
C

Chip Pearson

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
 
C

cucchiaino

Rasmus said:
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
......
 
T

Tom Ogilvy

Dim rng as Range
set rng = Range("A13")
do
set rng = rng.offset(1,0)
Loop while rng.entireRow.Hidden = True
rng.Select
 
S

Soo Cheon Jheong

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
 
T

Tom Ogilvy

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
 
Top