ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA used to resize objects? (https://www.excelbanter.com/excel-programming/442337-vba-used-resize-objects.html)

WA

VBA used to resize objects?
 
i am trying to resize all objects on a sheet. is there a way to assign a
variable, all the objects, rather then using the code below?


'resize charts
--- ActiveSheet.Shapes.Range(Array(4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20)).Select

Selection.ShapeRange.LockAspectRatio = msoFalse
Selection.ShapeRange.Width = 173.25
Selection.ShapeRange.Height = 102#


Thanks for your help

Dave Peterson

VBA used to resize objects?
 
First, it kind of looks like you're not hitting all the shapes (where are 1, 2,
3???) on that sheet.

Second, there are a lot of things that go into that shapes collection.

I'd be careful and use some of the routines from Ron de Bruin to make sure I
don't break a shape that shouldn't be touched.

Ron de Bruin has lots of code to work with shapes he
http://www.rondebruin.nl/controlsobjectsworksheet.htm

WA wrote:

i am trying to resize all objects on a sheet. is there a way to assign a
variable, all the objects, rather then using the code below?

'resize charts
--- ActiveSheet.Shapes.Range(Array(4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20)).Select

Selection.ShapeRange.LockAspectRatio = msoFalse
Selection.ShapeRange.Width = 173.25
Selection.ShapeRange.Height = 102#

Thanks for your help


--

Dave Peterson

WA

VBA used to resize objects?
 
great - i'll look into it - thanks

"Dave Peterson" wrote:

First, it kind of looks like you're not hitting all the shapes (where are 1, 2,
3???) on that sheet.

Second, there are a lot of things that go into that shapes collection.

I'd be careful and use some of the routines from Ron de Bruin to make sure I
don't break a shape that shouldn't be touched.

Ron de Bruin has lots of code to work with shapes he
http://www.rondebruin.nl/controlsobjectsworksheet.htm

WA wrote:

i am trying to resize all objects on a sheet. is there a way to assign a
variable, all the objects, rather then using the code below?

'resize charts
--- ActiveSheet.Shapes.Range(Array(4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20)).Select

Selection.ShapeRange.LockAspectRatio = msoFalse
Selection.ShapeRange.Width = 173.25
Selection.ShapeRange.Height = 102#

Thanks for your help


--

Dave Peterson
.



All times are GMT +1. The time now is 06:22 AM.

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