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
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
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:
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!![]()
Please Login or Register to view this content.
Not all forums are the same - seek and you shall find
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
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 assistedor failed to assist you
I welcome your Feedback.
This worked for me. The above code will remove all shapes not just the buttons.
![]()
Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks