Link to home
Start Free TrialLog in
Avatar of Jagwarman
Jagwarman

asked on

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
Avatar of Roy Cox
Roy Cox
Flag of United Kingdom of Great Britain and Northern Ireland image

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
ASKER CERTIFIED SOLUTION
Avatar of Norie
Norie

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Jagwarman
Jagwarman

ASKER

thanks Norie, so simple when you know how.