Sub test()
Dim r As Long, c As Long, rowsHeights As Double, columnsWidth As Double
Dim myDocument As Worksheet
Dim objLine As Line
Set myDocument = Worksheets("Sheet1")
With myDocument 'Change here
For Each objLine In .Lines
rowsHeights = 0
columnsWidth = 0
Select Case objLine.Name
Case "LineATop"
For r = 1 To .Range(.Range("A2").Value).Row - 1
rowsHeights = rowsHeights + .Cells(r, 1).Height
Next
For c = 1 To .Range(.Range("A2").Value).Column - 1
columnsWidth = columnsWidth + .Cells(1, c).Width
Next
objLine.Top = rowsHeights
objLine.Left = columnsWidth
Case "LineAMiddle"
For r = 1 To .Range(.Range("B2").Value).Row - 1
rowsHeights = rowsHeights + .Cells(r, 1).Height
Next
For c = 1 To .Range(.Range("B2").Value).Column - 1
columnsWidth = columnsWidth + .Cells(1, c).Width
Next
rowsHeights = rowsHeights + (.Cells(r, 1).Height / 2)
objLine.Top = rowsHeights
objLine.Left = columnsWidth
Case "LineABottom"
For r = 1 To .Range(.Range("C2").Value).Row
rowsHeights = rowsHeights + .Cells(r, 1).Height
Next
For c = 1 To .Range(.Range("C2").Value).Column - 1
columnsWidth = columnsWidth + .Cells(1, c).Width
Next
objLine.Top = rowsHeights
objLine.Left = columnsWidth
End Select
Next
End With
End Sub