Digita
02-24-2009, 05:19 PM
Hi All,
Thanks for reading this post. I have a long list of data with rows of variable heights. I have many shape objects imbedded in form of pictures in a particular column for each row in the list. The code below resizes all the shapes and moves them in a particular manner.
Dim sShapes As Shape
'Loop through all shapes on Worksheet
For Each sShapes In ActiveSheet.Shapes
If Left(sShapes.Name, 7) = "Picture" Then
With sShapes
.ScaleWidth 0.5, msoFalse, msoScaleFromTopLeft
.ScaleHeight 0.4, msoFalse, msoScaleFromTopLeft
.IncrementLeft 0.75
.IncrementTop 27.75
End With
End If
Next sShapes
The problem I have after running the code is that the shapes have not been correctly aligned to the rows. Some are slightly below or above their original rows. :banghead:
I want to fix the position of the shapes so that they all align within the row and at the bottom left corner of the cells they are in. There is no such thing as "IncrementBottom" for the shapes object as the opposite to "IncrementTop", is there? Any workaround?
Enclosed is a small sample file for ease of reference. Hope you can help. Thanks in advance.
Regards
kp
Thanks for reading this post. I have a long list of data with rows of variable heights. I have many shape objects imbedded in form of pictures in a particular column for each row in the list. The code below resizes all the shapes and moves them in a particular manner.
Dim sShapes As Shape
'Loop through all shapes on Worksheet
For Each sShapes In ActiveSheet.Shapes
If Left(sShapes.Name, 7) = "Picture" Then
With sShapes
.ScaleWidth 0.5, msoFalse, msoScaleFromTopLeft
.ScaleHeight 0.4, msoFalse, msoScaleFromTopLeft
.IncrementLeft 0.75
.IncrementTop 27.75
End With
End If
Next sShapes
The problem I have after running the code is that the shapes have not been correctly aligned to the rows. Some are slightly below or above their original rows. :banghead:
I want to fix the position of the shapes so that they all align within the row and at the bottom left corner of the cells they are in. There is no such thing as "IncrementBottom" for the shapes object as the opposite to "IncrementTop", is there? Any workaround?
Enclosed is a small sample file for ease of reference. Hope you can help. Thanks in advance.
Regards
kp