Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to limit "Unhide Rows" Macro?
The "unhide additional rows" macro provided by Jacob works great (below), but
I need to limit the # of rows affected. The max # of additional rows available is 16, if the user enters "17" an error will occur. How can I apply this limit? Thank You, Robert "Jacob Skaria" wrote: With Sheets("Inputs").Select x = Range("U2") Y = Range("X2") Rows(x & ":" & Y).EntireRow.Hidden = False Range("A" & Y).Activate End With |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to limit "Unhide Rows" Macro?
If I understand your question correctly, I would think something like this
will work... With Sheets("Inputs").Select X = Range("U2") Y = Range("X2") If Y - X < 16 Then Rows(X & ":" & Y).Hidden = False Range("A" & Y).Activate Else MsgBox "You specified too many rows to unhide!" End If End With -- Rick (MVP - Excel) "RLY" wrote in message ... The "unhide additional rows" macro provided by Jacob works great (below), but I need to limit the # of rows affected. The max # of additional rows available is 16, if the user enters "17" an error will occur. How can I apply this limit? Thank You, Robert "Jacob Skaria" wrote: With Sheets("Inputs").Select x = Range("U2") Y = Range("X2") Rows(x & ":" & Y).EntireRow.Hidden = False Range("A" & Y).Activate End With |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to limit "Unhide Rows" Macro?
That worked great,
Thank you. "Rick Rothstein" wrote: If I understand your question correctly, I would think something like this will work... With Sheets("Inputs").Select X = Range("U2") Y = Range("X2") If Y - X < 16 Then Rows(X & ":" & Y).Hidden = False Range("A" & Y).Activate Else MsgBox "You specified too many rows to unhide!" End If End With -- Rick (MVP - Excel) "RLY" wrote in message ... The "unhide additional rows" macro provided by Jacob works great (below), but I need to limit the # of rows affected. The max # of additional rows available is 16, if the user enters "17" an error will occur. How can I apply this limit? Thank You, Robert "Jacob Skaria" wrote: With Sheets("Inputs").Select x = Range("U2") Y = Range("X2") Rows(x & ":" & Y).EntireRow.Hidden = False Range("A" & Y).Activate End With |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to Unhide MulipleRows if Cell B10 has a "X" otherwise hide c | Excel Programming | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
Read ".dll" files, the Macro "work flow" and the actual values of the variables when Macro is running | Excel Programming | |||
Macro to concatenate into "B1" B2 thru B"x" based on new data in "Col A" | Excel Discussion (Misc queries) | |||
If "x" Hide / Unhide Rows | Excel Discussion (Misc queries) |