Specific cell with 2 connectors, up and dow

Doflamingo

Board Regular
Joined
Apr 16, 2019
Messages
238
Hi all,

I try to find the lines of code that would allow me to put the right up connector to a cell

Here you can see what I have

https://www.dropbox.com/s/95uvji7ageuumy9/Connector flaw.png?dl=0

and what I would like

https://www.dropbox.com/s/c49g3t9v9xzlhf2/connector proper.png?dl=0

any idea how to make appear the connector between the line 8 and 9 ?

Here is the code

Private Sub CommandButton3_Click()
Dim orig As Range, dest As Range, con As Shape, up As Range, down As Range
'location of the LP
qty = WorksheetFunction.RoundUp((ListBox1.ListCount * 2 - 1) / 2, 0)
With Cells(10, qty + 2)
.ColumnWidth = 15
.Value = TextBox4.Value
.BorderAround
.HorizontalAlignment = xlCenter
.Borders.Weight = 3
End With

Set orig = Cells(10, qty + 2)
Set dest = Cells(15, qty + 2)
Set con = ActiveSheet.Shapes.AddConnector(1, orig.Left + orig.Width / 2, _
orig.Top + orig.Height, dest.Left + dest.Width / 2, dest.Top)
con.Line.Weight = 1
con.Line.ForeColor.RGB = RGB(0, 0, 0)
Set orig = orig.Offset(, 2)
Set dest = dest.Offset(, 2)

Set up = Cells(8, qty + 2)
Set down = Cells(9, qty + 2)
Set con = ActiveSheet.Shapes.AddConnector(1, orig.Left + orig.Width / 2, _
orig.Top + orig.Height, dest.Left + dest.Width / 2, dest.Top)
con.Line.Weight = 1
con.Line.ForeColor.RGB = RGB(0, 0, 0)
Set up = orig.Offset(, 2)
Set down = dest.Offset(, 2)

End Sub

the connector below the cell works perfectly, but not the connector above....

Any ideas :confused:
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Here remains the big question of how to connect connectors by a single one

Here is the thread


[h=2]Linking connectors by a larger connector[/h]
 
Upvote 0

Forum statistics

Threads
1,215,094
Messages
6,123,071
Members
449,092
Latest member
ipruravindra

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top