Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
P_R P_R is offline
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,646
Default 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
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
Averaging values from a list, based on user input MWS Excel Worksheet Functions 3 June 5th 07 06:47 PM
Incrementing Data based on user input learningaccess Excel Discussion (Misc queries) 3 January 26th 07 03:28 PM
I would like to sort a work sheet based upon user input value,(dat John Bundy Excel Worksheet Functions 0 November 30th 06 04:18 PM
I would like to sort a work sheet based upon user input value,(dat A1CaddMan Excel Worksheet Functions 0 November 29th 06 03:53 PM
Finding a record based on user input Soundman Excel Discussion (Misc queries) 5 June 21st 05 03:06 AM


All times are GMT +1. The time now is 03:17 PM.

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"