Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Worksheet selection based on properties.idname 1

Status
Not open for further replies.

Vashkar

Programmer
Sep 16, 2012
14
NL
Worksheet:
has an id-number: 1
has a tabname: "Test" - properties: Name
has an id-name: Sheet1 - properties: (Name)

to select the worksheet:
Worksheets(1).Select
Worksheets("Test").Select
?

I need to reference the Sheet1 option, but I have no idea on the how.

Also I'm a bit stuck on finding documentation on it since all take in regard the Worksheets("[tabname]") and Worksheets([id-no.]).
I have no idea what the needed identifier is called as it's also shown as (Name) in properties. And that makes it a bit hard to find anything regarding.

Can anyone put me in the right direction, please?




 
Forgot to mention:
Working with Excel-2007
 
Hi,

Sheet1.Select

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
That property is the CodeName property

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
hahahaha, really that simple? OMG.
You don't want to know how many variants I've tried nót to come to that one.
Well, that's a good laugh at my own expense.

Thanks mate. Much appreciated.
 
I make a practice of using sheet CodeName quite a bit. I usually change the CodeName to something meaningful like wsData for a sheet containing my source data or wsPivot for a sheet with a PivotTable.

That way, even if the user changes the sheet name, my code works. The sheet CodeName can ONLY be change via VBA code or in the VBA editor.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top