View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
New2Macros New2Macros is offline
external usenet poster
 
Posts: 22
Default Macro to show/hide rows

New2Macros:

Sorry I'm not being clear enough. Say in cell A1 you want to enter the
number of rows being shown in the spreadsheet. A1 should always be shown, of
course, and each number entered in A1 will show double the amount of rows
below. Each row starting with A2 will have information entered previously,
so we are just displaying, or hiding those rows below. For instance: if I
want only 2 rows displaying below, I would enter a "1" in cell A1. If I want
10 rows to show, I would enter "5" in A1, and so on. A1 probably will have a
pull down.



"Rick Rothstein (MVP - VB)" wrote:

I don't completely understand your criteria. From your example, if the user
picks 2, how do you know to start showing rows at Row 3? And if you hide
everything except for Rows 3 through 6, then B1 will be hidden and you won't
be able to change the number in it again without manually unhiding it. Can
you give us more details on how you want this functionality to work (keep in
mind that no one here has any idea what you want to do, so you have to tell
us).

Rick


"New2Macros" wrote in message
...
That is close. What I need is that you can choose from 1 to 35 (maybe in
a
pull down), and have it show the twice that many rows. So if you pick 2
it
would show rows 3 through 6 and hide all the other pre-populated rows.

Also when I plugged in that macro I'm getting an error '1004'. "Unable to
set the hidden property of the range class."



"New2Macros" wrote:

I need to use a single cell to show/hide other rows. For instance if you
put
a "6" in cell B1 it would show the next 12 rows and hide the rest. If
you
put in a "10" it would show the next 20 rows and hide the rest, etc.

I'm new to writing macros, sorry!