riteoh01
03-07-2012, 04:06 PM
Hi,
I have used the following code to create and name a shape :
ActiveSheet.Shapes.AddShape(msoShapeRectangle, 736.25, 330#, 97.25, 63#).Select
Selection.ShapeRange.Fill.Visible = msoTrue
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Fill.ForeColor.SchemeColor = 65
Selection.ShapeRange.Fill.Transparency = 0#
Selection.ShapeRange.Line.Weight = 0.75
Selection.ShapeRange.Line.DashStyle = msoLineSolid
Selection.ShapeRange.Line.Style = msoLineSingle
Selection.ShapeRange.Line.Transparency = 0#
Selection.ShapeRange.Line.Visible = msoTrue
With Selection
.Name = ButtonHide
End With
I now want to use a new macro to delete this same shape - however I'm not sure how to reference the named shape, and my knowledge of VBA is limited to copying and trying to understand code I read n the next. Can anybody provide any hints?
Thanks
I have used the following code to create and name a shape :
ActiveSheet.Shapes.AddShape(msoShapeRectangle, 736.25, 330#, 97.25, 63#).Select
Selection.ShapeRange.Fill.Visible = msoTrue
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Fill.ForeColor.SchemeColor = 65
Selection.ShapeRange.Fill.Transparency = 0#
Selection.ShapeRange.Line.Weight = 0.75
Selection.ShapeRange.Line.DashStyle = msoLineSolid
Selection.ShapeRange.Line.Style = msoLineSingle
Selection.ShapeRange.Line.Transparency = 0#
Selection.ShapeRange.Line.Visible = msoTrue
With Selection
.Name = ButtonHide
End With
I now want to use a new macro to delete this same shape - however I'm not sure how to reference the named shape, and my knowledge of VBA is limited to copying and trying to understand code I read n the next. Can anybody provide any hints?
Thanks