Sheet code name

G

Guest

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
 
B

Bob Phillips

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)
 

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