+ Reply to Thread
Results 1 to 5 of 5

Macro to Automatically Hide/Unhide Rows Based on Checkbox

  1. #1
    Registered User
    Join Date
    08-02-2012
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2003
    Posts
    9

    Macro to Automatically Hide/Unhide Rows Based on Checkbox

    I've been searching forums and trying codes for days and cannot solve this problem. PLEASE HELP! I'm in a bit of a time crunch.
    Unfortunately I cannot post an example because it's confidential data.

    On a sheet titled "Criteria Checklist," there are several checkboxes linked to cells that return a 1 or 0 when checked/unchecked.
    On a sheet titled "Checklist Results," I have 3 rows I need to hide/unhide; these are rows 53-55. I have A53, A54, and A55 set equal to the checkbox formulas (0 or 1) on the Critera Checklist sheet.

    If any of these rows is a 0 (i.e. the box on "Critera Checklist" was unchecked), I want that specific row to be automatically hidden. (I.e., if column A for Rows 53 thru 55 reads 0, 1, 0, I want rows 53 and 55 to hide.) But I want this all to run AUTOMATICALLY...So the hiding/unhiding will toggle right along with the checking/unchecking of the boxes.

    To add to the complication, if all 3 rows = 0 (all boxes are unchecked), I also want to hide row 52.

    Please help! And I'm a newbie to VBA so please specify where/how I need to paste in the code. Thank you!!!!

  2. #2
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    re: Macro to Automatically Hide/Unhide Rows Based on Checkbox

    Hello bga10s,

    You don't say if the Checkboxes are From Controls or Active X Controls.

    See this Thread; http://www.excelforum.com/excel-prog...-checkbox.html

    Maybe it could set you on track.

    Regards.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  3. #3
    Registered User
    Join Date
    08-02-2012
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2003
    Posts
    9

    re: Macro to Automatically Hide/Unhide Rows Based on Checkbox

    Sorry, it's just a Form Control. I checked out your link but I don't think it does what I want in terms of automatically hiding/unhiding the rows based on the checkbox on the other sheet?

  4. #4
    Registered User
    Join Date
    08-02-2012
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Macro to Automatically Hide/Unhide Rows Based on Checkbox

    SOLVED IT. In all of my desperate searching I finally found something that works:

    http://www.excelbanter.com/showthread.php?t=294042

  5. #5
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Macro to Automatically Hide/Unhide Rows Based on Checkbox

    Hello bga10s,

    Thank you for the feedback.

    Be careful with using that Code as is, since it could easily run into an indefinate loop, leaving your system "Hanging".

    I would strongly suggest you use something along the lines of the Code as Posted below, you may change the Ranges to suit;

    Please Login or Register  to view this content.
    Hope that helps.

    Regards.

+ 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. Automatically hide and unhide rows based on value in cell
    By kmham in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 11-28-2014, 12:03 PM
  2. [SOLVED] Macro to automatically hide or unhide rows based on either a value or no value in a cell
    By WFP111 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-04-2013, 12:28 PM
  3. [SOLVED] Macro to hide/unhide rows using more than one checkbox
    By tsou in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-29-2013, 08:37 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. Macro to hide/unhide rows using checkbox
    By jdp554 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-23-2011, 11:57 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