+ Reply to Thread
Results 1 to 5 of 5

Show/Hide Grouped Rows/Columns

  1. #1
    Forum Contributor
    Join Date
    06-21-2010
    Location
    -
    MS-Off Ver
    Excel 2010
    Posts
    1,211

    Show/Hide Grouped Rows/Columns

    I'm using an Active X Toggle Button to show/Hide Grouped Columns with the following code:

    Please Login or Register  to view this content.
    However, I would like to use a 'Shape' instead of a 'Toggle Button'. How would I adapt the code to achieve this?

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Show/Hide Grouped Rows/Columns

    Hi Hangman,

    You could name your shape:

    Please Login or Register  to view this content.
    Then you could test if it was selected in a Worksheet_Change Event:

    Please Login or Register  to view this content.
    or, of course, your toggle code.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Forum Contributor
    Join Date
    06-21-2010
    Location
    -
    MS-Off Ver
    Excel 2010
    Posts
    1,211

    Re: Show/Hide Grouped Rows/Columns

    Hi xladept,

    I'm new to VBA and I'm unsure if I use a shape whether this has to run using a macro or quite how the code would look for a shape rather than a command button?

    I tried replacing the 'Toggle Button' references in my code with the name of my Shape, but that doesn't work, so I'm not sure how to adapt the code correctly?

    Are you able to provide an example? The attached worksheet, shows it working with a toggle button, but I want to code the shape to do the same thing and that is where my knowledge falls down!
    Attached Files Attached Files

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Show/Hide Grouped Rows/Columns

    Hi Hangman,

    Here's Throck there's Module 1 code for naming your shape and worksheet code for executing your code.

    Throck.xlsm

  5. #5
    Forum Contributor
    Join Date
    06-21-2010
    Location
    -
    MS-Off Ver
    Excel 2010
    Posts
    1,211

    Re: Show/Hide Grouped Rows/Columns

    xladept,

    Many thanks for your help, all working now...

+ 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