change size of object

C

choice

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
 
R

Rowan

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top