Thebatfink
Active Member
- Joined
- Apr 8, 2007
- Messages
- 410
Hi,
I'm struggling to get this working using codenames rather than the sheets name. I have various workbooks which I'm going to be cycling through, and whilst the codenames are all identical in each workbook, the sheetnames are all named different as they have various dates on them..
When I open a book I want to perform some formatting and formula inserts etc in to each sheet .. In the past when sheetnames were identical I'd of just used
I need a way of turning this into using codenames. I've tried
and
as some examples seem to suggest, but it doesn't work and I'm not sure what the correct way of handling this should be. Any help would be greatly appreciated.
Thanks
Batfink!
I'm struggling to get this working using codenames rather than the sheets name. I have various workbooks which I'm going to be cycling through, and whilst the codenames are all identical in each workbook, the sheetnames are all named different as they have various dates on them..
When I open a book I want to perform some formatting and formula inserts etc in to each sheet .. In the past when sheetnames were identical I'd of just used
Code:
Dim sh as worksheet
For Each Sh In Worksheets(Array("Sheet2", "Sheet3", "Sheet7", "Sheet8"))
Next sh
I need a way of turning this into using codenames. I've tried
Code:
For Each Sh In Worksheets(Array("Sheet2.name", "Sheet3.name", "Sheet7.name", _
"Sheet8.name"))
and
Code:
For Each Sh In Worksheets(Array(2, 3, 7, 8)
as some examples seem to suggest, but it doesn't work and I'm not sure what the correct way of handling this should be. Any help would be greatly appreciated.
Thanks
Batfink!
Last edited: