+ Reply to Thread
Results 1 to 2 of 2

Querying shape name and location from VBA

  1. #1
    Registered User
    Join Date
    08-19-2010
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    5

    Querying shape name and location from VBA

    Doing some 'for love' programming for my wife to help with a work project, I've hit a bit of a hurdle. My spreadsheet runs through a number of individual datasets relating to specific projects on the first sheet, and produces a nice graphical representation of hours worked on the second (refer the image link below for an example output).

    Her company would like to be able to export this output to a second workbook (easy) to allow it to be issued to clients. They want the detailed data below each header row to be able to be expanded/collapsed by clicking a button next to the header row, as indicated on my mock-up output picture.

    I'm fine with the coding to flip the button the other way up, determine the length up the data subset and hide/unhide it, etc BUT what I can't work out is this:

    If I assign a macro to a shape and click it, how do I:

    1) Query the name of the shape that was clicked so that I can then invert it using msoFlipVertical

    2) Query which row the shape is located in so that I can collapse/expand the relevant data set

    I'm a dodgy occasional programmer so I propose 'toggling' the expand/collapse routines by writing to a hidden cell - eg '1' = currently expanded; '0' = currently collapsed. Working with Control Toolbox toggle buttons just didn't work the way I wanted.

    Any help greatly appreciated!

    \1
    Last edited by Moph; 08-19-2010 at 03:42 AM. Reason: Solved

  2. #2
    Registered User
    Join Date
    08-19-2010
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Querying shape name and location from VBA

    Okay. That was easy! Solved it myself

    Please Login or Register  to view this content.

+ 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