Line drawing data into cells in Excel

%3CLINGO-SUB%20id%3D%22lingo-sub-2251622%22%20slang%3D%22en-US%22%3ELine%20drawing%20data%20into%20cells%20in%20Excel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2251622%22%20slang%3D%22en-US%22%3E%3CP%3EDoes%20anyone%20know%20how%20to%20automatically%20save%20the%20height%20and%20width%20of%20lines%20drawn%20in%20excel%3F%26nbsp%3B%20If%20you%20draw%20a%20line%20Excel%20displays%20the%20height%20and%20width%3F.%26nbsp%3B%20I%20would%20like%20to%20save%20those%20values%20do%20do%20calculations.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2251622%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Occasional Visitor

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 calculations.

1 Reply

@grandajj 

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