Macro to Unhide Rows

R

RLY

Need help with an excel 2003 macro to simply unhide a certain number of rows
in a spreadsheet (# of rows to be unhidden is based on user input).
Here's what I have & it's not working...

With Sheets("Inputs").Select
X = Range("U2")
Y = Range("X2")
Rows("X:Y", 0).Select
Range("Y").Activate
Selection.EntireRow.Hidden = False
End With

U2 is a fixed entry, the row # in X2 is calculated based on a user input (#
of additional rows required).
Thanks, Robert
 
D

Dave Peterson

With Sheets("Inputs")
X = .Range("U2").value
Y = .Range("X2").value
.Rows(x & ":" & y).hidden = False
End With
 
R

RLY

That sure works - Thank You!

Jacob Skaria said:
With Sheets("Inputs").Select
x = Range("U2")
Y = Range("X2")
Rows(x & ":" & Y).EntireRow.Hidden = False
Range("A" & Y).Activate
End With

If this post helps click Yes
 
R

RLY

One more issue:
The max # of additional rows that can be unhidden is 16. How can I apply
this limit within the macro (if the user enters "17" an error will occur)...?
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

Similar Threads


Top