Forum Discussion
grandajj
Apr 03, 2021Copper Contributor
Line drawing data into cells in Excel
Does anyone know how to automatically save the height and width of lines drawn in excel? If you draw a line Excel displays the height and width?. I would like to save those values do do calculation...
PeterBartholomew1
Apr 03, 2021Silver Contributor
You need VBA to handle shapes.
Dim shp As Shape
Set shp = Sheet1.Shapes("Straight Connector 1")
a = shp.Height
b = shp.Width
length = (a * a + b * b) ^ 0.5