Dimensions of Shapes
Solved
duduleray
-
Patrice33740 Posted messages 8400 Registration date Status Member Last intervention -
Patrice33740 Posted messages 8400 Registration date Status Member Last intervention -
Hello everyone, Forum hello,
<config>Windows 10 / Edge 81.0.416.68</Excel 2007>
I have inserted several shapes on my sheet 1, including a square and 5 rectangular shapes of different sizes.
I would like to know please where to find or how to calculate the dimensions of each shape.
Example: Rectangle 1 = ???
Top =
Left =
Width =
Height =
Thank you all for your help, have a good end of the afternoon.
Best regards, Dudu
<config>Windows 10 / Edge 81.0.416.68</Excel 2007>
I have inserted several shapes on my sheet 1, including a square and 5 rectangular shapes of different sizes.
I would like to know please where to find or how to calculate the dimensions of each shape.
Example: Rectangle 1 = ???
Top =
Left =
Width =
Height =
Thank you all for your help, have a good end of the afternoon.
Best regards, Dudu
4 answers
-
Hello,
Simply put:Sub test() Dim shp As Shape For Each shp In Worksheets("Sheet1").Shapes Debug.Print shp.Name, "T:" & shp.Top, "L:" & shp.Left, "W:" & shp.Width, "H:" & shp.Height Next shp End Sub
Best regards
Patrice
No one can possess all knowledge, that's why we share it. -
Hello,
I don't understand your request, I gave you the solution here:
https://forums.commentcamarche.net/forum/affich-36579126-deplacer-des-shapes-ou-formes#1
--
See you later, Le Pivert -
Hi Patrice 33740,
Thank you for your reply and the little code.
I have the code in a module, then on my Sheet1 I selected a shape and ran the macro
but no result is displayed on the screen, could you please show the result in a MSGBOX with the name of the selected shape and of course the dimensions.
For your information, each shape has a different name
Thank you for your help, it's nice of you.
Best regards, Dudu-
My code lists all the shapes on the sheet and their dimensions in the VBE execution window.
Here is a tutorial on the VBE and its windows: https://tutoriel-vba.espaceweb.usherbrooke.ca/vba_VBE.html
When using a tool, you must start by learning how to use it.
-
-
Hi Le pivert, Patrice,
Thank you for your remark, you are right, I apologize, I completely forgot the code you made for me.
I haven't found it yet, but this time it's organized.
Thanks again to both of you, and I'm sorry.
Have a good evening and thanks again.
I will therefore close the subject.
Best regards, Dudu