ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   delete picture with macro (https://www.excelbanter.com/excel-discussion-misc-queries/77846-delete-picture-macro.html)

Steve

delete picture with macro
 
I have added a macro that will copy a piece of word art and assigned it to a
control button and paste it over a employee on a daily timesheet. I use this
when an employee is off for the day. I have also made another macro that
clears the contents of all relevant cells on the timesheet. I include with
this macro a cut command for the word art to be removed. However, not every
employee is off on the same day so I get a error if the wordart is not there.
Is there any way to fix this so that it will remove the wordart on the
relevant employee?
Thanks in advance

Ron de Bruin

delete picture with macro
 
Hi Steve

See
http://www.rondebruin.nl/controlsobjectsworksheet.htm


Sub Shapes2()
'Loop through the Shapes collection and use the Type number of the control
Dim myshape As Shape
For Each myshape In ActiveSheet.Shapes

If myshape.Type = 15 Then myshape.Delete
' You can also use myshape.Visible = False

Next myshape
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Steve" wrote in message ...
I have added a macro that will copy a piece of word art and assigned it to a
control button and paste it over a employee on a daily timesheet. I use this
when an employee is off for the day. I have also made another macro that
clears the contents of all relevant cells on the timesheet. I include with
this macro a cut command for the word art to be removed. However, not every
employee is off on the same day so I get a error if the wordart is not there.
Is there any way to fix this so that it will remove the wordart on the
relevant employee?
Thanks in advance





All times are GMT +1. The time now is 12:25 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com