frank_m
12-12-2010, 10:18 PM
I wrote this Macro to create a msoShapeCross and position it relative to column 9 on the active row.
It works fine, however now I need the proper command that will delete only the shapes on the sheet that are of this same type (msoShapeCross)
Thanks :help
Sub Macro4()
Dim LeftPos As Integer
Dim TopPos As Integer
Dim intWidth As Integer
Dim intHeight As Integer
TopPos = ActiveCell.Offset(0, 9 - ActiveCell.Column).Top
intWidth = 18
intHeight = 18
LeftPos = ActiveCell.Offset(0, 9 - ActiveCell.Column).Left
Dim sh As Shape
Set sh = ThisWorkbook.Worksheets("Tool_Log").Shapes.AddShape(msoShapeCross, _
LeftPos, TopPos, intWidth, intHeight)
With sh
.Placement = xlFreeFloating
.Fill.Visible = msoTrue
.Fill.Solid
.Fill.ForeColor.SchemeColor = 10
.OnAction = "MyMacro"
End With
End Sub
It works fine, however now I need the proper command that will delete only the shapes on the sheet that are of this same type (msoShapeCross)
Thanks :help
Sub Macro4()
Dim LeftPos As Integer
Dim TopPos As Integer
Dim intWidth As Integer
Dim intHeight As Integer
TopPos = ActiveCell.Offset(0, 9 - ActiveCell.Column).Top
intWidth = 18
intHeight = 18
LeftPos = ActiveCell.Offset(0, 9 - ActiveCell.Column).Left
Dim sh As Shape
Set sh = ThisWorkbook.Worksheets("Tool_Log").Shapes.AddShape(msoShapeCross, _
LeftPos, TopPos, intWidth, intHeight)
With sh
.Placement = xlFreeFloating
.Fill.Visible = msoTrue
.Fill.Solid
.Fill.ForeColor.SchemeColor = 10
.OnAction = "MyMacro"
End With
End Sub