+ Reply to Thread
Results 1 to 12 of 12

Hiding checkboxes

  1. #1
    Registered User
    Join Date
    12-08-2010
    Location
    NC, USA
    MS-Off Ver
    Excel 2007
    Posts
    5

    Hiding checkboxes

    I have an Excel spreadsheet that has 100 lines and each line has a checkbox. I want the ability to hide unused lines and the associated checkbox. When I hide or delete a line it "stacks" the check boxes and I end up with a pile of them sitting in the middle of my form. Is there a way to make them hide when I hide the line (row)?

  2. #2
    Forum Contributor
    Join Date
    11-25-2010
    Location
    Glasgow, Scotland
    MS-Off Ver
    Excel 2007
    Posts
    120

    Re: Hiding checkboxes

    Hi there,

    I've had some issues with this before, when you hide or change the row height the checkbox behaves differently. I think the only way you can accomplish this is by "toggling" the visibility of the checkbox. You should be able to do it with some VBA.
    If the post was helpful please click the black star on the bottom left to add some reputation and mark your thread as SOLVED.

    A day with nothing new achieved or learned, albeit however small, is a day lost forever?

    Constant Never Ending Improvement

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Hiding checkboxes

    Don't use CheckBoxes, use this code to simulate CheckBoxes in Column A

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

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Registered User
    Join Date
    08-11-2010
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Hiding checkboxes

    Quote Originally Posted by royUK View Post
    Don't use CheckBoxes, use this code to simulate CheckBoxes in Column A

    Please Login or Register  to view this content.
    Thanks very much. Is there any way to limit this to a range inside a column, not the whole column?

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Hiding checkboxes

    Just change it to this
    Please Login or Register  to view this content.
    Note: there's no need to quote previous replies in your posts

  6. #6
    Registered User
    Join Date
    08-11-2010
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Hiding checkboxes

    Thanks for your help

  7. #7
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Hiding checkboxes

    Thanks for the rep.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

  8. #8
    Registered User
    Join Date
    12-08-2010
    Location
    NC, USA
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Hiding checkboxes

    I solved the checkbox delima by resizing the checkbox so that the control frame fits inside the host cell. Now I can hide rows and do not have the "stacking" problem. I have encountered new new problem in that I am using a Form Control Option Button to hide/unhide blank rows but cannot get the macro to function correctly. Just so you know - I am macro illiterate and know next to nothing about them or how they work. Here is the code I copied and modified for my use: The purple portion is what is highlighted during debugging.


    Sub Hide_Unhide()

    Dim Rng As Range
    Dim MyCell As Range
    Set Rng = Range("E4:E103") (If a value is entered in this range then show row, if blank then hide row)
    For Each MyCell In Rng
    If MyCell.Value = "" Then
    MyCell.EntireRow.Hidden = ActiveSheet.CheckBoxes(Application.Caller).Value = xlOn
    End If
    Next MyCell

    End Sub
    Last edited by Petard; 12-09-2010 at 11:24 AM.

  9. #9
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Hiding checkboxes

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here

  10. #10
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Hiding checkboxes

    Rubix, you've continued your post in the wrong thread

  11. #11
    Registered User
    Join Date
    12-08-2010
    Location
    NC, USA
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Hiding checkboxes

    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    12-08-2010
    Location
    NC, USA
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Hiding checkboxes

    Apparently the Option Button does not toggle or it seems that once you click on it, it remains selected. I have now inserted a ActiveX toggle button. Button works great. Toggles back and forth, but it does nothing else. Still trying to hide empty rows. Open to any suggestions.

+ 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