How to programmatically access sheets in a workbook by code name

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi Again

I want to be able to refer to worksheets in a workbook programmatically that
way i wont have to worry if endusers will change the name of the worksheet.

Right now i'm using : ThisWorkbook.Worksheets("Sheet"1), but if i "Sheet1"
has a code name of 'secret', how can i go about getting a Worksheet reference
using that code name?
 
dim s as worksheet
set s=secret

Or (better) just use "secret" directly as in:

secret.Activate

Tim.
 

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

Back
Top