Deleting word art

MonkeyDeath

Board Regular
Joined
Jul 19, 2007
Messages
62
hi i have a code to insert a piece of word art in certain instances, but as the job progresses that wordart needs ot be removed.

the problem being is every time you put a pieceo f word art in it creates a new reference number for that word art

the code being

Code:
ActiveSheet.Shapes("WordArt 14").Select

every time i insert a new word art the number goes up.

how do i get it to remove the word ar regardless of what it is called
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.

Jonmo1

MrExcel MVP
Joined
Oct 12, 2006
Messages
44,061
Code:
For Each x In ActiveSheet.Shapes
    If Left(x.Name, 7) = "WordArt" Then x.Delete
Next x
 

royUK

Well-known Member
Joined
Jul 24, 2002
Messages
1,606
Name the Wordart as you add it

Code:
 .Name = "MyWordArt"

Then delete it at commemcement of the code
Code:
on Error resume Next
ActiveSheet.Shapes("MyWordArt").Select
Selection.Delete

'add wordart including name it

On Error Goto 0
 

Forum statistics

Threads
1,181,724
Messages
5,931,688
Members
436,798
Latest member
spprtpplcm

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top