Hi all,
How can I make a list of all the shapes I have created in my workbook. There are a couple that I made, stopped using, but never deleted and I don't want them within the workbook anymore.
Regards:
Hi all,
How can I make a list of all the shapes I have created in my workbook. There are a couple that I made, stopped using, but never deleted and I don't want them within the workbook anymore.
Regards:
Last edited by Mordred; 09-30-2011 at 08:06 PM.
If you're happy with someone's help, click that little star at the bottom left of their post to give them Reps.
---Keep on Coding in the Free World---
Hi Mordred,
That is a very good question. Had the same problem many moons ago, but my pc packed up and I was rid of the problem. However, Leith Ross never seizes to amaze me with his programming skills and knowledge ! I am sure he wont mind if you ask him for help. I too, would like to see how it can be resolved. Good Luck!
![]()
Sub x() Dim wks As Worksheet Dim shp As Shape For Each wks In Worksheets For Each shp In wks.Shapes Debug.Print shp.Name Next shp Next wks End Sub
Entia non sunt multiplicanda sine necessitate
If the goal is to delete them, a slight expansion on SHG's macro can offer you that opportunity:
![]()
Sub x() Dim wks As Worksheet Dim shp As Shape For Each wks In Worksheets For Each shp In wks.Shapes If MsgBox("Sheet " & wks.Name & " has a shape called '" & shp.Name _ & "', delete it?", vbYesNo, "Shape Found") = vbYes Then shp.Delete Next shp Next wks End Sub
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
?None of us is as good as all of us? - Ray Kroc
?Actually, I *am* a rocket scientist.? - JB (little ones count!)
Wow,
An excellent sample of the KISS principle. This Forum Rocks! Keep it up guys!
A slight change to JB's code will let you see what you may be deleting:
![]()
Sub x() Dim wks As Worksheet Dim shp As Shape For Each wks In Worksheets wks.Select For Each shp In wks.Shapes shp.Select If MsgBox(Title:="Whee!", _ Prompt:="Delete """ & shp.Name & """?", _ Buttons:=vbYesNo) = vbYes Then shp.Delete DoEvents End If Next shp Next wks End Sub
Thanks for the help guys, shg's amendment of Jerry's procedure is a keeper!
for a vba approach you can use the selection pane.
Home > Editing > Find & Select > Selection Pane.
You can use CTRL+Click to multi select and then delete.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks