![]() |
How find maximum top+height property of a collection of shapes
Does anyone know how to find the highest top and height property from
a collection of shapes? Basically I am trying to find the bottom of the lowest of a group of shapes in order to see how far downward on the worksheet in order so that I can draw a vertical line on the same worksheet but no lower than the lowest shape object on the worksheet. Thanks much, Chet |
How find maximum top+height property of a collection of shapes
One way, if I understand you correctly :
Public Sub LowestShape() Dim nLowest As Long Dim nTemp As Long Dim sh As Shape For Each sh In ActiveSheet.Shapes nTemp = sh.Top + sh.Height If nTemp nLowest Then nLowest = nTemp Next sh MsgBox "Height of line: " & nLowest End Sub In article .com, "Chet" wrote: Does anyone know how to find the highest top and height property from a collection of shapes? Basically I am trying to find the bottom of the lowest of a group of shapes in order to see how far downward on the worksheet in order so that I can draw a vertical line on the same worksheet but no lower than the lowest shape object on the worksheet. Thanks much, Chet |
How find maximum top+height property of a collection of shapes
Thanks much!... That worked like a charm.!....................
On Feb 19, 11:49 pm, JE McGimpsey wrote: One way, if I understand you correctly : Public Sub LowestShape() Dim nLowest As Long Dim nTemp As Long Dim sh As Shape For Each sh In ActiveSheet.Shapes nTemp = sh.Top+ sh.Height If nTemp nLowest Then nLowest = nTemp Next sh MsgBox "Height of line: " & nLowest End Sub In article .com, "Chet" wrote: Does anyone know how to find the highesttopand height property from a collection of shapes? Basically I am trying to find the bottom of the lowest of a group of shapes in order to see how far downward on the worksheet in order so that I can draw a vertical line on the same worksheet but no lower than the lowest shape object on the worksheet. Thanks much, Chet- Hide quoted text - - Show quoted text - |
All times are GMT +1. The time now is 02:05 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com