+ Reply to Thread
Results 1 to 5 of 5

Unhide rows using checkbox in excel 2010

  1. #1
    Registered User
    Join Date
    01-23-2014
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2003
    Posts
    11

    Unhide rows using checkbox in excel 2010

    Hi guys

    I have searched through the forum a few times but can't find my solution.

    I am trying to build a sheet where, upon opening the sheet, rows (say 5 to 10, then 11 to 15) are hidden.

    The user will have two checkboxes to choose from.

    When checkbox 1 is selected, rows 5 to 10 are unhidden. If checkbox 1 is clicked again, rows 5 to 10 disappear again.

    Checkbox 2 unhides and hides rows 11 to 15.

    The code for the opposite of this scenario (hides rows when selected) is as follows:

    Please Login or Register  to view this content.
    I have tried recording the scenario on excel, but so far have had no success. I'm sure this is ridiculously easy for someone out there...

    Thanks for reading, please reply if you have any good ideas!

  2. #2
    Forum Contributor
    Join Date
    12-14-2013
    Location
    Tilburg, Nederland
    MS-Off Ver
    Excel 2010
    Posts
    256

    Re: Unhide rows using checkbox in excel 2010

    This may help you:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    01-23-2014
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Unhide rows using checkbox in excel 2010

    Hi Gerard

    Thanks for your reply.

    I have copied the code supplied into excel, however I am now getting the following error: 'Run-time error '424' - Object required'.

    On debug, the error is displaying on line 2 "If CheckBox1.Value = True Then".

    I'm sure this is close to the solution though!

  4. #4
    Forum Contributor
    Join Date
    12-14-2013
    Location
    Tilburg, Nederland
    MS-Off Ver
    Excel 2010
    Posts
    256

    Re: Unhide rows using checkbox in excel 2010

    Ok, I couldn't see what kind of control you where using.
    Place a ActiveX check box in the sheet and dubbel click it than it opens the IDE.
    Place the code in the created privite sub of the ActiveX control.

  5. #5
    Registered User
    Join Date
    01-23-2014
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Unhide rows using checkbox in excel 2010

    Gerard, thanks again. I omitted to mention I was using form controls!

    I am now using ActiveX as you suggest, and the code is compiling.

    However, this is working in a similar fashion to my old code: when the box is ticked, the rows disappear - I need the opposite to happen.

    However, I simply inverted the 'True' and 'False' statements and everything works perfectly.

    Thanks a million buddy!

+ 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. Checkbox to hide and unhide rows
    By xjenniex in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-08-2014, 04:42 PM
  2. [SOLVED] hide and unhide rows in different worksheet using a checkbox
    By jjin in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-08-2014, 10:20 AM
  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. hide/unhide rows using checkbox
    By elfirahayu in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-20-2010, 03:31 PM
  5. Hide / unhide rows with help of a checkbox
    By Hansa in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-03-2009, 12:56 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