ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Looping A Variable Used Within An Object Name (https://www.excelbanter.com/excel-programming/406907-looping-variable-used-within-object-name.html)

Tommy[_4_]

Looping A Variable Used Within An Object Name
 
Hi guys,

Simple bit of code:

For c = 2 To Nofcharts

With Worksheets(SheetName)
Set ZoomArray(c) = .Zoom & c
End With

Next c

What I want to do is to be able to loop through a number of objects
(they are toggle buttons) called Zoom2, Zoom3, Zoom4 etc. Obviously
the code above doesn't work, so how can I modify it so that it is able
to set e.g. ZoomArray(5) = .Zoom5

Thanks and regards,

Tom


All times are GMT +1. The time now is 01:23 PM.

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