• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 166
  • Last Modified:

vba to open a sheet if I don't know name of sheet

I would normally open a sheet in Excel using Sheets("Name of sheet").Select

But is it possible to open a sheet if I don't know the name of the sheet ][because the user changes the name ] but I know it is always on Sheet5

Thanks
0
Jagwarman
Asked:
Jagwarman
1 Solution
 
Roy CoxGroup Finance ManagerCommented:
I would rename the Sheet's code name and use that.in the code

You can refer to the sheet by it's Index number i.e it's position in the sheet but that's not reliable.

See this

http://excel-it.com/excel_sheet_names.html
0
 
NorieVBA ExpertCommented:
If you mean Sheet5 is the codename try this.
Sheet5.Select 

Open in new window

0
 
JagwarmanAuthor Commented:
thanks Norie, so simple when you know how.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now