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

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Code:
For Each x In ActiveSheet.Shapes
    If Left(x.Name, 7) = "WordArt" Then x.Delete
Next x
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,215,046
Messages
6,122,854
Members
449,096
Latest member
Erald

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
Back
Top