Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
RLY RLY is offline
external usenet poster
 
Posts: 7
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default 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   Report Post  
Posted to microsoft.public.excel.programming
RLY RLY is offline
external usenet poster
 
Posts: 7
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to Unhide MulipleRows if Cell B10 has a "X" otherwise hide c Leiprecht Excel Programming 3 March 31st 09 09:30 PM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
Read ".dll" files, the Macro "work flow" and the actual values of the variables when Macro is running [email protected] Excel Programming 5 May 16th 07 08:18 PM
Macro to concatenate into "B1" B2 thru B"x" based on new data in "Col A" Dennis Excel Discussion (Misc queries) 0 July 17th 06 02:38 PM
If "x" Hide / Unhide Rows Ed Excel Discussion (Misc queries) 4 April 18th 06 06:39 PM


All times are GMT +1. The time now is 08:36 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"