Remove (Shape) Straight Line

Solved/Closed
smuneeb Posts 67 Registration date Saturday September 5, 2015 Status Member Last seen March 8, 2017 - Nov 18, 2015 at 05:24 PM
smuneeb Posts 67 Registration date Saturday September 5, 2015 Status Member Last seen March 8, 2017 - Nov 19, 2015 at 02:54 AM
Hello
I would like to request how to remove straight line shape through vba

It was made through the following vba code

Sub Str_line()
ActiveSheet.Shapes.AddLine(259, 169#, 341, 169).Select
Selection.ShapeRange.Line.EndArrowheadStyle = msoArrowheadNone
Selection.ShapeRange.Line.Weight = 1#
Selection.ShapeRange.Line.DashStyle = msoLineSolid
Selection.ShapeRange.Line.ForeColor.SchemeColor = 0
End Sub


Thanks & Regards

1 response

Name the Line:
Selection.ShapeRange.Name = "smuneeb line"

to delete:
ActiveSheet.Shapes("smuneeb line").Delete
0
smuneeb Posts 67 Registration date Saturday September 5, 2015 Status Member Last seen March 8, 2017 1
Nov 19, 2015 at 02:05 AM
Hi
Awesome Great Job
0
smuneeb Posts 67 Registration date Saturday September 5, 2015 Status Member Last seen March 8, 2017 1
Nov 19, 2015 at 02:54 AM
Hi
Its a request to related query is that, is shows an error if any cell is selected
Please solve this issue either it selected the shape or not.
Thanks
0