Hi Hans,
Try something like:
'==========>>
Public Sub Tester()
Dim SH As Worksheet
Dim SHP As Shape
Const sShape As String = "Rectangle 1"
Set SH = ThisWorkbook.Sheets("Sheet1")
With SH
On Error Resume Next
Set SHP = .Shapes(sShape)
On Error GoTo 0
If Not SHP Is Nothing Then
'\\ your code
Else
Set SHP = .Shapes.AddShape _
(Type:=msoShapeRectangle, _
Left:=20, _
Top:=50, _
Width:=100, _
Height:=50)
End If
End With
End Sub
'<<==========
---
Regards.
Norman
"Hans Hubers" <(E-Mail Removed)> wrote in message
news:BC1A0B31-4F93-48BB-92A5-(E-Mail Removed)...
>I am creating shapes, but the user can delete them. Then if the VBA code
> wants to updat the shape with some information in cells, the code should
> check if the shape exists and otherwise create it.
|