VBA Code that Unhides rows

Grammarjunkie

Board Regular
Joined
Mar 22, 2016
Messages
86
Hi, guys!

I have a bunch of VBA codes to reveal rows depending on the answers of a dropdown in certain cells.
I.E. - If F101 has "Y" or "y", row 102 is revealed, else it stays hidden.

My question is this: some people in my dpt don't use the dropdowns and instead would rather type in the letter (hence my doing Y and y). When they answer "y" in 101, and then press enter to accept it, row 102 is revealed, but they're in cell F103 since row 102 "didn't exist" when they pressed enter.

Is there an easy something to put into the vba code so that when they press enter, it simultaneously goes to F102 as 102 is revealed?


I feel like this is a ridiculous request, and it probably isn't easy by any means. If possible at all. So I have no qualms telling them to get over it or use the dropdowns that I put. :p

Thanks for any help!
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Without seeing your code I am somewhat guessing, but couldn't you just put a line of code to activate the Cell immediately after unhiding the row?

Something along the lines of
Rich (BB code):
...your code...
R = [your row number]
Rows(R).Hidden = False
Range("A"&R).Activate
 
Last edited:
Upvote 0
Without seeing your code I am somewhat guessing, but couldn't you just put a line of code to activate the Cell immediately after unhiding the row?

Something along the lines of
Rich (BB code):
...your code...
R = [your row number]
Rows(R).Hidden = False
Range("A"&R).Activate


Sorry, I always feel like a question is a general thing and specific codes aren't worth mentioning. But if it helps,

Code:
If Range("F101") = "Y" Then
    Rows("102").Hidden = False
Else
    Rows("102").Hidden = True
End If


So how does your fit into that? At the end?
 
Upvote 0
Assuming you have each row hide/unhide section listed out, you would need to add the following new line to each section (with the correct row number)

Rich (BB code):
If Range("F101") = "Y" Then
    Rows("102").Hidden = False
    Range("F102").Activate
Else
    Rows("102").Hidden = True
End If
 
Upvote 0

Forum statistics

Threads
1,216,110
Messages
6,128,894
Members
449,477
Latest member
panjongshing

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