+ Reply to Thread
Results 1 to 5 of 5

Selecting All Buttons

  1. #1
    Forum Contributor
    Join Date
    11-17-2006
    Posts
    152

    Selecting All Buttons

    Hi,

    Is there a way from VBA of selecting all the button on a sheet then deleting them? at the moment i'm selecting and deleting them all seperately. is there a quick way?

    Thanks

  2. #2
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161
    If you're deleting the same buttons every time why not record a macro?, start the recorder and select the buttons as an array by holdng down Ctrl when you click each button, go to your recorded macro and and it will look something like this:
    Please Login or Register  to view this content.
    then add some code to delete them like:
    Please Login or Register  to view this content.
    if the code doesn't work the way to do it by hand is to select them as a group (array) as explained above and then choose cut!
    Not all forums are the same - seek and you shall find

  3. #3
    Forum Contributor
    Join Date
    11-17-2006
    Posts
    152
    hi,

    I've been using the array method but I think I didn't explain myself very well, can all the button be selected without defining there names? the reason i ask is i am copying sheets to new a workbook, where in excel 2000 and excel 2007 give the button different names, so selecting button names then delete works for one version and not the other.

    Thanks

  4. #4
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    jonn

    depending on if you have other objects on the sheet you could use

    Please Login or Register  to view this content.
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

  5. #5
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    This worked for me. The above code will remove all shapes not just the buttons.
    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