Remove (Shape) Straight Line [Solved/Closed]

smuneeb
Posts
77
Registration date
Saturday September 5, 2015
Last seen
March 8, 2017
- Nov 18, 2015 at 05:24 PM - Latest reply: smuneeb
Posts
77
Registration date
Saturday September 5, 2015
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
See more 

3 replies

0
Thank you
Name the Line:
Selection.ShapeRange.Name = "smuneeb line"

to delete:
ActiveSheet.Shapes("smuneeb line").Delete
smuneeb
Posts
77
Registration date
Saturday September 5, 2015
Last seen
March 8, 2017
- Nov 19, 2015 at 02:05 AM
Hi
Awesome Great Job
smuneeb
Posts
77
Registration date
Saturday September 5, 2015
Last seen
March 8, 2017
- 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