ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   change size of object (https://www.excelbanter.com/excel-programming/327054-change-size-object.html)

choice[_2_]

change size of object
 
Sub changesquare()
Sheets("IZEN").activate
ActiveSheet.Shapes("izensquare").Select
Selection.ShapeRange.ScaleHeight Range("f4").Value, msoFalse,
msoScaleFromTopLeft
Selection.ShapeRange.ScaleWidth Range("d4").Value, msoFalse,
msoScaleFromTopLeft
Range("a1").Select
End Sub

this changes the object by a percentage, how do i go about changing the size
to like inches, if in f4 it says 5 have it 5inches, not 500% of current size

thanks in advance

Rowan[_2_]

change size of object
 
You can set the pixel size of the shape like this:

Sub changesquare()
Sheets("IZEN").Activate
ActiveSheet.Shapes("izensquare").Select
Selection.ShapeRange.Height = Range("F4").Value
Selection.ShapeRange.Width = Range("D4").Value
Range("A1").Select
End Sub

So for 5 inches your value in D4 would need to somewhere in the high hundreds.

Hope this helps
Rowan

"choice" wrote:

Sub changesquare()
Sheets("IZEN").activate
ActiveSheet.Shapes("izensquare").Select
Selection.ShapeRange.ScaleHeight Range("f4").Value, msoFalse,
msoScaleFromTopLeft
Selection.ShapeRange.ScaleWidth Range("d4").Value, msoFalse,
msoScaleFromTopLeft
Range("a1").Select
End Sub

this changes the object by a percentage, how do i go about changing the size
to like inches, if in f4 it says 5 have it 5inches, not 500% of current size

thanks in advance



All times are GMT +1. The time now is 11:39 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com