Forum Discussion
jragan
Nov 05, 2021Copper Contributor
Object positioning
I have an excel worksheet that creates a diagram. Below are attached the original creation of the diagram and also the new version of the diagram from the modified program. The user wants to know...
PeterBartholomew1
Nov 08, 2021Silver Contributor
I can see why your client is not totally thrilled. If you go into the VBA, shape positions may be set by using their .left and .top properties. Ranges also return such properties so the shape could either be set by the location in points or set to match the grid.
Set shp = Sheet1.Shapes(1)
shp.left = rng.left
shp.Top = rng.Top
shp.Rotation = 45
- jraganNov 09, 2021Copper ContributorPeter,
Thank you for your reply. The problem for me is that I do not see any code that is assigning position to any shape as you have demonstrated above. I will keep looking though.
Thank you again.
John- PeterBartholomew1Nov 09, 2021Silver ContributorJohn
How was the diagram created? Was it simply a diagram created by hand? Changing the size of the underlying mesh can change the shapes, depending on their settings. Rotating shapes is unusual, though.- jraganNov 10, 2021Copper ContributorThe diagram is actually created by VBA code. The objects are all defined and the shapes are turned on or off depending on user input on the excel sheet. It does not use any positioning logic and from what I am learning from the user they reposition objects to line up they way they want them for each diagram created for their customer. Thank you for your answer.