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
 
Joined
Jun 24, 2013
Messages
1
Reaction score
0
Sub JumpToNextVisibleColumn()

Dim Rng As Range
Set Rng = ActiveCell.Offset(0, 1)

While Rng.EntireColumn.Hidden = True
Set Rng = Rng.Offset(0, 1)
Wend

Rng.Activate

End Sub


Sub JumpToNextVisibleRow()

Dim Rng As Range
Set Rng = ActiveCell.Offset(1, 0)

While Rng.EntireRow.Hidden = True
Set Rng = Rng.Offset(1, 0)
Wend

Rng.Activate

End Sub
 
Joined
May 31, 2017
Messages
1
Reaction score
0
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
......
Hi Sir,
I was apply above code in my userform, it was worked well at small database. but I have faced a issue that I have a large database with rows around 75000 approx, so when i applied that loop at visible cell, my excel was going to crashed (ie. loop from row 100 to row 15000 ) excel did not respond. is their any solution?
 
Joined
May 20, 2022
Messages
1
Reaction score
0
Hi, Rasmus.

Try this

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


Hi, I know that my comment is only 18 years after your comment, I just hope you are doing fine and you're well, because your comment helped me the most.

I signed up on this website just to thank you.
 

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