Sub
Doit()
Dim
ShSource
As
Worksheet, ShTarget
As
Worksheet
Dim
oSource
As
Shape, oTarget
As
Shape
Dim
oShp
As
Shape
Set
ShSource = ThisWorkbook.Sheets(
"Recipe"
)
Set
ShTarget = ThisWorkbook.Sheets(
"Pizza"
)
On
Error
GoTo
fail
Set
oShp = ShSource.Shapes(
"TextBox 1"
)
Set
oShp = ShTarget.Shapes(
"TextBox 1"
)
ShSource.Shapes(
"TextBox 1"
).Copy
With
ShTarget
.Paste
Set
oShp = .Shapes(.Shapes.Count)
With
oShp
.Left = ShTarget.Shapes(
"TextBox 1"
).Left
.Top = ShTarget.Shapes(
"TextBox 1"
).Top
ShTarget.Shapes(
"TextBox 1"
).Delete
oShp.Name =
"TextBox 1"
oShp.Visible =
Not
oShp.Visible
oShp.Visible =
Not
oShp.Visible
End
With
End
With
On
Error
GoTo
0
fail:
If
Err.Number <> 0
Then
MsgBox
"TextBox 1 is missing"
Set
oShp =
Nothing
Set
ShTarget =
Nothing
Set
ShSource =
Nothing
End
Sub