+ Reply to Thread
Results 1 to 7 of 7

Dynamic Table with Drop Down List

  1. #1
    Registered User
    Join Date
    04-19-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    16

    Dynamic Table with Drop Down List

    I have a table that has 1000 rows. Most of the time, only 30-50 lines are necessary. I would like to create a table that shrinks and expands, based on a drop down list. So, if the list is comprised of 25, 50, 100, 500, etc., I want that to change the size of the table, so that the table has 25,50,100, 500 rows.

    Can this be done?

    Thank you so much!
    -h

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    8,541

    Re: Dynamic Table with Drop Down List

    Try to study OFFSET function. Can you upload an example file?

  3. #3
    Registered User
    Join Date
    04-19-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Dynamic Table with Drop Down List

    How do I upload a file (I am new to this site, and I just can't seem to find the appropriate icon)?

  4. #4
    Registered User
    Join Date
    04-19-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Dynamic Table with Drop Down List

    There you go!
    Attached Files Attached Files

  5. #5
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,577

    Re: Dynamic Table with Drop Down List

    Try this code in the worksheet
    Please Login or Register  to view this content.
    Does that work for you?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  6. #6
    Registered User
    Join Date
    04-19-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Dynamic Table with Drop Down List

    Where do I put the code. I pushed Alt F11, then selected the appropriate sheet, and copied the text into the blank space on the right. Do I do something after that?

    Thank you for your patience!
    -h

  7. #7
    Registered User
    Join Date
    04-19-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Dynamic Table with Drop Down List

    I can get it to work in the example file I attached, but not in the actual workbook I am building. Is there a reason for that? I had to make a change - would that affect it?

    I changed it to the following to account where the table is set (see changes in red):

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Address = "$E$3" Then
    Range("A1:A1012").EntireRow.Hidden = False
    Range("A" & Target.Value + 13 & ":A1013").EntireRow.Hidden = True
    End If
    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1