Doflamingo
Board Regular
- Joined
- Apr 16, 2019
- Messages
- 238
Dear All,
Here is the code for horizontal connector for an active cell where the connector displays at the middle of that cell. Its lenght is half of the previous cell + current cell + half of the next cell.
@Dante gave me kindly those lines of code.
Now I try to find, following the same line of code but for an Vertical connector that would go down 3 lines from the active cell
Any ideas ?Here is my code, but does not work
Here is the code for horizontal connector for an active cell where the connector displays at the middle of that cell. Its lenght is half of the previous cell + current cell + half of the next cell.
@Dante gave me kindly those lines of code.
Code:
l = (ActiveCell.Offset(0, -1).Left + ActiveCell.Left) / 2
r = (ActiveCell.Offset(0, 1).Left + ActiveCell.Offset(0, 2).Left) / 2
t = (ActiveCell.Top + ActiveCell.Offset(1, 0).Top) / 2
Set con = ActiveSheet.Shapes.AddConnector(msoConnectorStraight, l, t, r, t)
con.line.Weight = 1
con.line.ForeColor.RGB = RGB(0, 0, 0)
Now I try to find, following the same line of code but for an Vertical connector that would go down 3 lines from the active cell
Any ideas ?Here is my code, but does not work
Code:
Sub con_vertical()
l = (ActiveCell) / 2
r = (ActiveCell.Top)
t = (ActiveCell.Top + 3)
Set con = ActiveSheet.Shapes.AddConnector(msoConnectorStraight, l, r, l, t)
con.line.Weight = 1
con.line.ForeColor.RGB = RGB(0, 0, 0)
End Sub