Select the VISIBLE row above the selected cell?

9tanstaafl9

Well-known Member
Joined
Mar 23, 2008
Messages
535
Hi all. I want to select the VISIBLE ROW above the currently selected cell. How do I do that? There are a variable number of hidden rows in between. I tried the macro recorder, but it was no use in this instance.

Is there a sneaky way to do this? Actually, I know there is, I'm pretty sure this is one of those things I used to know how to do but I forgot. I hate getting older.

Jennifer
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Is this a start?

Code:
Range("A1:A100").SpecialCells(xlCellTypeVisible).EntireRow.Select
 
Upvote 0
Hi,

Simply has to be a better way then this but...

Code:
Sub NextVisibleCell()

    If Selection.Row = 1 Then Exit Sub
    
    Selection.Offset(-1).Select
    
    Do Until Selection.EntireRow.Hidden = False
        Selection.Offset(-1).Select
    Loop

End Sub
 
Upvote 0
Is this a start?

Code:
Range("A1:A100").SpecialCells(xlCellTypeVisible).EntireRow.Select


Actually though, I only want to select the very next visible cell directly above the cell that is currently selected. Kind of like using the arrow key to go one up, because the rows are hidden.

Ok, I am the world's stupidest person. Could I just use the arrow key to go one up? Duh. I appologize. Forget I asked the question. Is there a way to delete this post. Which of these emoticons means I am so embarassed?

I have been up all night on other macro issues. I am not entirely stupid under normal circumstances!
 
Upvote 0
I think I'm the stupidest person for failing to read the question properly :oops:
 
Upvote 0
Hi,

Simply has to be a better way then this but...

Code:
Sub NextVisibleCell()
 
    If Selection.Row = 1 Then Exit Sub
 
    Selection.Offset(-1).Select
 
    Do Until Selection.EntireRow.Hidden = False
        Selection.Offset(-1).Select
    Loop
 
End Sub


Just realized this myself. I have been up all night trying to finish this project for a deadline. This question related to a very minor other issue that was the last thing keeping me up. Brain fart!
 
Upvote 0

Forum statistics

Threads
1,214,957
Messages
6,122,466
Members
449,086
Latest member
kwindels

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top