+ Reply to Thread
Results 1 to 5 of 5

Select a button on an active cell

  1. #1
    Registered User
    Join Date
    12-29-2010
    Location
    Ottawa, Canada
    MS-Off Ver
    Excel 2004 for Mac
    Posts
    20

    Select a button on an active cell

    Hi,

    I would like to run a macro to hide/show a button that is on top of an active cell when another button is pressed. I want this to be a generic code for multiple button's, therefore I can't use a typical...

    Please Login or Register  to view this content.
    ... because this requires a specific button name.

    I think if I found a function that did the opposite of an Application.Caller, that would work. This would allow me to potentially select the button that lies on top of the active cell. However, I don't know if this function exists.

    Does this function exist? Or is there another way to hide/show the button?

    Please note that these buttons are from the "forms" toolbar.

    Thanks!
    Last edited by DonkeyOte; 01-02-2011 at 06:21 AM. Reason: added tags (one liner)

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Select a button on an active cell

    Would iterating the Shapes and testing the Bottom Right Cell property work ?

    Please Login or Register  to view this content.
    when first creating set the sub as Public such that you can Assign it to your Master Button - then revert to Private so you can't invoke it from native XL other than via the Master Button(s) to which it is assigned (realistically)

    the above would Toggle visibility - ie if cell button is visible it will be hidden, if hidden it will become visible etc...

    edit: obviously if you ever upgrade to 2008 you have a problem
    Last edited by DonkeyOte; 01-02-2011 at 07:04 AM. Reason: reinstated .address !

  3. #3
    Registered User
    Join Date
    12-29-2010
    Location
    Ottawa, Canada
    MS-Off Ver
    Excel 2004 for Mac
    Posts
    20

    Re: Select a button on an active cell

    Hi,

    Is there a way to use the same code but, rather than change the visibility, change the caption to equal the contents in A1?

    Thanks

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Select a button on an active cell

    If I've understood - replace the visible toggle line with:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    12-29-2010
    Location
    Ottawa, Canada
    MS-Off Ver
    Excel 2004 for Mac
    Posts
    20

    Re: Select a button on an active cell

    That worked perfectly.

    Thank you!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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