Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
show a number of rows based upon user input
Hey all,
So I want to display only a certain number of rows in a table based upon how many the user needs (the user will be inputting information into this table, but that's not really relevant to the problem). I have a cell designated for them to input their value, and then I want the table to automatically adjust based on this input. I've tried feverishly to do this with lists, custom filters, and advanced filters but have had no luck. Any help would be greatly appreciated! PS - I've been exposed to VBA, but haven't had much experience with it. I'm actually hoping that there is an easy way to do this in VBA that my lack of experience has prevented me from figuring out. That is, if it can't be done without messing with code. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
show a number of rows based upon user input
Try this macro:
Sub showrows(fromRow, toRow) Rows("1:" & Rows.Count).EntireRow.Hidden = False Rows("2:" & fromRow - 1).EntireRow.Hidden = True 'row 1 (header) is always shown Rows(toRow + 1 & ":" & Rows.Count).EntireRow.Hidden = True End Sub Usage: Call showrows(20, 40) ' Replace constant figures by your cell values! Regards, Stefi P_R ezt *rta: Hey all, So I want to display only a certain number of rows in a table based upon how many the user needs (the user will be inputting information into this table, but that's not really relevant to the problem). I have a cell designated for them to input their value, and then I want the table to automatically adjust based on this input. I've tried feverishly to do this with lists, custom filters, and advanced filters but have had no luck. Any help would be greatly appreciated! PS - I've been exposed to VBA, but haven't had much experience with it. I'm actually hoping that there is an easy way to do this in VBA that my lack of experience has prevented me from figuring out. That is, if it can't be done without messing with code. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Averaging values from a list, based on user input | Excel Worksheet Functions | |||
Incrementing Data based on user input | Excel Discussion (Misc queries) | |||
I would like to sort a work sheet based upon user input value,(dat | Excel Worksheet Functions | |||
I would like to sort a work sheet based upon user input value,(dat | Excel Worksheet Functions | |||
Finding a record based on user input | Excel Discussion (Misc queries) |