Access worksheet by name

  • Thread starter Thread starter stefantem
  • Start date Start date
S

stefantem

I have a workbook with many worksheets which are not in order. So I
can't use worksheets(a).

Ex: If a=2 then I want to use Sheet2, not the second sheet.
 
So, what is your problem ? You have 2 ways to reference a sheet :
1. using indexing in a worksheets object collection : worksheets(a)
where a is an integer.
2. using naming worksheets("sheet_name")

There's nothing you can do more. :
 

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