Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default How to programmatically access sheets in a workbook by code name

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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default How to programmatically access sheets in a workbook by code name

dim s as worksheet
set s=secret

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

secret.Activate

Tim.


"Bing" wrote in message
...
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?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sharing a Workbook But Restricting Access to Certain Sheets Brandy Excel Discussion (Misc queries) 4 June 16th 08 07:58 PM
How to repeat a code for selected sheets (or a contiguous range of sheets) in a Workbook? Dmitry Excel Worksheet Functions 6 March 29th 06 12:43 PM
access sheets in another workbook Stuby Excel Programming 6 April 21st 04 08:29 PM
Code to make sheets in a workbook visible Jonsson[_4_] Excel Programming 5 January 30th 04 12:38 PM
How to hide sheets and VBA code in my Excel workbook? Rick[_13_] Excel Programming 0 August 26th 03 04:01 AM


All times are GMT +1. The time now is 01:00 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"