+ Reply to Thread
Results 1 to 6 of 6

User form/checkbox hide/unhide rows based on cell value

  1. #1
    Registered User
    Join Date
    09-11-2014
    Location
    Ontario,CA
    MS-Off Ver
    MS 2010
    Posts
    3

    User form/checkbox hide/unhide rows based on cell value

    Hi All! I am new to VBA. I need help trying to use a checkbox to hide/or unhide rows based on a cell in that row. I have two checkboxes in a user form that appears when a command button is pressed on in the spreadsheet, “DG”, “BIA”. The values of the cells that determines if the row will be hidden or not is in column AB, it will either says “DG” or “BIA” (if DG is checked, then the row should appear if AB12 for example says “DG”). the entire table range is A9:AB36, row 9 being the headers.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: User form/checkbox hide/unhide rows based on cell value

    Hello ldonis,

    Welcome to the Forum!

    Can you post your workbook? It will make it easier to answer your question.

    How To Post Your Workbook
    1. At the bottom right of the Reply window, Click the button Go Advanced
    2. At the top of the Your Message Window, in the first row of icons, Click the Paperclip icon.
    3. Click the Add Files button at the top right in the dialog box. This displays the File Manager dialog.
    4. Click the Select Files button at the bottom middle of the dialog.
    5. In the new window Find the file you want to upload, select it, and Click Open.
    6. You will now be back in the File Manager dialog. Click the bottom Middle button Upload File.
    7. Wait until the file has completely uploaded before you exit the File Manager dialog.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    09-11-2014
    Location
    Ontario,CA
    MS-Off Ver
    MS 2010
    Posts
    3

    Re: User form/checkbox hide/unhide rows based on cell value

    Here you go
    Attached Files Attached Files
    Last edited by ldonis; 09-11-2014 at 01:44 PM.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: User form/checkbox hide/unhide rows based on cell value

    Hello ldonis,

    Paste this code into your UserForm. It work fine for me. The attached workbook also has the code added.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    09-11-2014
    Location
    Ontario,CA
    MS-Off Ver
    MS 2010
    Posts
    3

    Thumbs up Re: User form/checkbox hide/unhide rows based on cell value

    That's Great! It worked. I might have couple more questions on it later to make it work for about seven different check boxes and one for the subtotal line as well. Thanks for the help!

  6. #6
    Registered User
    Join Date
    09-12-2014
    Location
    Hanoi
    MS-Off Ver
    2013
    Posts
    1

    Re: User form/checkbox hide/unhide rows based on cell value

    Thank @Leith Ross, It's usefull for me also.
    hungtt7

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Macro to Automatically Hide/Unhide Rows Based on Checkbox
    By bga10s in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-27-2014, 07:32 PM
  2. [SOLVED] Hide/unhide Cell contents based on checkbox
    By Kelton in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-25-2014, 04:25 PM
  3. Hide/unhide rows based on form input
    By Nicolas Mous in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-17-2014, 10:49 AM
  4. [SOLVED] Checkbox VBA - Hide/Unhide Rows and/or Columns based on cell values
    By gravy258 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-21-2013, 05:39 PM
  5. [SOLVED] Hide/Unhide Rows based on Combo Box (form control)
    By JimExcel in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-01-2013, 09:38 AM

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