Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Hans,
Better would be something like: '========== Public Sub Tester() Dim SH As Worksheet Dim SHP As Shape Dim Rng As Range Const sShape As String _ = "Rectangle 1" '<<==== CHANGE Set SH = ThisWorkbook. _ Sheets("Sheet1") '<<==== CHANGE With SH Set Rng = Range("A2") '<<==== CHANGE On Error Resume Next Set SHP = .Shapes(sShape) On Error GoTo 0 If SHP Is Nothing Then Set SHP = .Shapes.AddShape _ (Type:=msoShapeRectangle, _ Left:=20, _ Top:=50, _ Width:=100, _ Height:=50) End If End With '\\ your code, e.g.: With SHP .TextEffect.Text = Range("A1").Value .Name = sShape End With End Sub '<<========== --- Regards. Norman |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Check for a tab if it is exist | Excel Discussion (Misc queries) | |||
How to check worksheets exist or not ? | Excel Programming | |||
Does Shape Exist? | Excel Programming | |||
Check if a value exist in a column | Excel Worksheet Functions | |||
Check if pivot already exist | Excel Programming |