+ Reply to Thread
Results 1 to 3 of 3

VBA code to unhide X number of rows based on a number entered into a cell above

  1. #1
    Registered User
    Join Date
    11-09-2010
    Location
    Auckland, New Zealand
    MS-Off Ver
    Excel 2007
    Posts
    32

    VBA code to unhide X number of rows based on a number entered into a cell above

    Hi all,

    I am reasonably new to VBA so any help would be appreciated. I'm using excel 2007 but I'd like the workbook to be compatible with older versions if possible.

    I have a worksheet with a table for filling out employee data. I want users to be able to enter how many employees they have into a text box and for the table to then display that number of rows for them to fill out. The number of employees ("X") can vary from 1 to 100.

    I was thinking the best way to do it would be to start with all the rows of the table hidden (i.e. rows 1:100) and then have some code that unhides rows 1:X whenever the number in the text box is changed. Trouble is I'm not sure how to do this.

    Thanks in advance
    G

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Thumbs down Re: VBA code to unhide X number of rows based on a number entered into a cell above

    This should work for you I think. Make sure you try it on a copy of your workbook.

    Please Login or Register  to view this content.
    If I am missing something that you need let me know.

  3. #3
    Registered User
    Join Date
    11-09-2010
    Location
    Auckland, New Zealand
    MS-Off Ver
    Excel 2007
    Posts
    32

    Re: VBA code to unhide X number of rows based on a number entered into a cell above

    Thanks... that's working perfectly.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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