ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Sheet code name (https://www.excelbanter.com/excel-programming/355334-sheet-code-name.html)

Harley

Sheet code name
 
How do I refer to a sheet by it's code name? I have to sheets in a workbook
that data is written to, and want to add the date to the tab name. In the
project explorer the names are refered to as Sheet1, Sheet2,.... The code
below fails when trying to substitute the names in the explorer window.

'Sheets(Array("Open Items", "Requires verification")).Select
Sheets(Array(Sheet1, Sheet2)).Select

Bob Phillips[_6_]

Sheet code name
 
With ActiveWorkbook.VBProject.VBComponents
Sheets(Array(CStr(.Item("Sheet1").Properties("Name ")), _
CStr(.Item("Sheet2").Properties("Name")), _
CStr(.Item("Sheet3").Properties("Name")))).Select
End With


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Harley" wrote in message
...
How do I refer to a sheet by it's code name? I have to sheets in a

workbook
that data is written to, and want to add the date to the tab name. In the
project explorer the names are refered to as Sheet1, Sheet2,.... The code
below fails when trying to substitute the names in the explorer window.

'Sheets(Array("Open Items", "Requires verification")).Select
Sheets(Array(Sheet1, Sheet2)).Select





All times are GMT +1. The time now is 05:40 PM.

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