sonnychong
New Member
- Joined
- Feb 6, 2012
- Messages
- 17
hi there everyone. i've been searching in this forum for quite some time now, but this is my first post here.
i've got this code
written by erik.van.geit (http://www.mrexcel.com/forum/showthread.php?t=264775&highlight=draw+line+on+spreadsheet).
this is kind of similar to what i'm searching for. but instead having the length of the line equal to the length of 1 cell, can the length of the line be determined by the amount of cells that i've selected.
eg: let's say on row 2, i've selected cells c2 to h2, and the line is drawn according to it. and on row 3, i've selected cells d3 to g3, and the line is drawn according to it.
anyone have any ideas how this can be done? thank you
i've got this code
Code:
Sub test2()
Dim ThisLine As Shape
With ActiveCell
Set ThisLine = ActiveSheet.Shapes.AddLine(.Left, .Top, .Left + .Width, .Top)
End With
With ThisLine.Line
.BeginArrowheadStyle = msoArrowheadOval
.EndArrowheadStyle = msoArrowheadOval
.BeginArrowheadWidth = msoArrowheadWidthMedium
.BeginArrowheadLength = msoArrowheadLengthMedium
.EndArrowheadWidth = msoArrowheadWidthMedium
.EndArrowheadLength = msoArrowheadLengthMedium
.Visible = msoTrue
End With
written by erik.van.geit (http://www.mrexcel.com/forum/showthread.php?t=264775&highlight=draw+line+on+spreadsheet).
this is kind of similar to what i'm searching for. but instead having the length of the line equal to the length of 1 cell, can the length of the line be determined by the amount of cells that i've selected.
eg: let's say on row 2, i've selected cells c2 to h2, and the line is drawn according to it. and on row 3, i've selected cells d3 to g3, and the line is drawn according to it.
anyone have any ideas how this can be done? thank you