+ Reply to Thread
Results 1 to 3 of 3

Checkbox Macro to Hide/Unhide Rows Not Working Properly

  1. #1
    Registered User
    Join Date
    09-29-2020
    Location
    Washington, DC
    MS-Off Ver
    MS Office 365
    Posts
    2

    Question Checkbox Macro to Hide/Unhide Rows Not Working Properly

    I have a checkbox that I am trying to use to hide and unhide rows. The rows start off hidden, and the aim is to have the rows revealed when the checkbox is checked and then hidden again if the checkbox is unchecked. The code I am using is below. Rather than unhiding and hiding the rows as I'd like, the code does nothing. When I switch the spots of the "1" and "0" as seen below, it will unhide the rows when the checkbox is checked, but it won't re-hide the cells when it is unchecked.

    Code that does nothing:
    Please Login or Register  to view this content.
    Code that unhides but does not re-hide rows:
    Please Login or Register  to view this content.
    What am I missing/doing wrong with the macro to get it to perform as I'd like?
    Last edited by Richard Buttrey; 09-29-2020 at 06:51 PM.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Checkbox Macro to Hide/Unhide Rows Not Working Properly

    Hi,

    Try changing the = 1 to =True, and =0 to = False

    Incidentally we have a forum rule about wrapping code in code tags to make it easier to read, particularly with large procedures. I'll edit your post sibce you're new here but please remember the next time.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    09-29-2020
    Location
    Washington, DC
    MS-Off Ver
    MS Office 365
    Posts
    2

    Re: Checkbox Macro to Hide/Unhide Rows Not Working Properly

    Hi Richard,

    The same thing happens when I use True/False instead of 1/0.

    Thanks for making the edit to the post! I'll make note of the code tags for future posts.

    RM

+ 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. Hide Unhide Rows using Checkbox
    By Huskersippi in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-28-2014, 05:08 PM
  2. [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
  3. Checkbox to hide and unhide rows
    By xjenniex in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-08-2014, 04:42 PM
  4. [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
  5. Hide rows macro not working properly
    By lgastal in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-09-2012, 11:43 PM
  6. 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
  7. hide/unhide rows using checkbox
    By elfirahayu in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-20-2010, 03:31 PM

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