Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 93
Default Using CodeName when Selecting Multi-Tabs

I am hoping that someone is experienced in using the Sheet CodeNames when
selecting Multiple Sheets. I know that you can use Sheet5.Select to go to
sheet 5, even though the sheet may have been renamed by the user, sheet 5
remains constant in Properties. I can select multiple sheets, using
Sheets(Array("MySheet", "YourSheet", "ThereSheet")).Select. But, I want to
be able to use the CodeName instead, I'm unable to find any references to
doing so. By using the CodeName, I wouldn't have to track the changes in the
user applied sheet names. Can anyone help me on this? I appreciate it. Dean
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Using CodeName when Selecting Multi-Tabs

sheets(array(Sheet1.Name, Sheet5.Name, Sheet7.Name)).Select

--
regards,
Tom Ogilvy


"Dean" wrote in message
...
I am hoping that someone is experienced in using the Sheet CodeNames when
selecting Multiple Sheets. I know that you can use Sheet5.Select to go to
sheet 5, even though the sheet may have been renamed by the user, sheet 5
remains constant in Properties. I can select multiple sheets, using
Sheets(Array("MySheet", "YourSheet", "ThereSheet")).Select. But, I want

to
be able to use the CodeName instead, I'm unable to find any references to
doing so. By using the CodeName, I wouldn't have to track the changes in

the
user applied sheet names. Can anyone help me on this? I appreciate it.

Dean


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 93
Default Using CodeName when Selecting Multi-Tabs

Thanks Tom, very much. Dean

"Tom Ogilvy" wrote:

sheets(array(Sheet1.Name, Sheet5.Name, Sheet7.Name)).Select

--
regards,
Tom Ogilvy


"Dean" wrote in message
...
I am hoping that someone is experienced in using the Sheet CodeNames when
selecting Multiple Sheets. I know that you can use Sheet5.Select to go to
sheet 5, even though the sheet may have been renamed by the user, sheet 5
remains constant in Properties. I can select multiple sheets, using
Sheets(Array("MySheet", "YourSheet", "ThereSheet")).Select. But, I want

to
be able to use the CodeName instead, I'm unable to find any references to
doing so. By using the CodeName, I wouldn't have to track the changes in

the
user applied sheet names. Can anyone help me on this? I appreciate it.

Dean



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Using CodeName when Selecting Multi-Tabs

Hi,

This si just what I'm looking for, but is there a shorter way of writing it?

I need to select sheets 1 to 17 which becomes a lengthy bit of code!

Thanks
merry_fay

"Dean" wrote:

Thanks Tom, very much. Dean

"Tom Ogilvy" wrote:

sheets(array(Sheet1.Name, Sheet5.Name, Sheet7.Name)).Select

--
regards,
Tom Ogilvy


"Dean" wrote in message
...
I am hoping that someone is experienced in using the Sheet CodeNames when
selecting Multiple Sheets. I know that you can use Sheet5.Select to go to
sheet 5, even though the sheet may have been renamed by the user, sheet 5
remains constant in Properties. I can select multiple sheets, using
Sheets(Array("MySheet", "YourSheet", "ThereSheet")).Select. But, I want

to
be able to use the CodeName instead, I'm unable to find any references to
doing so. By using the CodeName, I wouldn't have to track the changes in

the
user applied sheet names. Can anyone help me on this? I appreciate it.

Dean



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Using CodeName when Selecting Multi-Tabs

Try something like

Dim Arr() As String
Dim N As Long
ReDim Arr(1 To 17)
For N = 1 To 17
Arr(N) = ThisWorkbook.VBProject. _
VBComponents("Sheet" & CStr(N)).Name
Next N
Worksheets(Arr).Select

Cordially,
Chip Pearson
Microsoft Most Valuable Professional,
Excel, 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com




On Wed, 17 Mar 2010 12:53:02 -0700, merry_fay
wrote:

Hi,

This si just what I'm looking for, but is there a shorter way of writing it?

I need to select sheets 1 to 17 which becomes a lengthy bit of code!

Thanks
merry_fay

"Dean" wrote:

Thanks Tom, very much. Dean

"Tom Ogilvy" wrote:

sheets(array(Sheet1.Name, Sheet5.Name, Sheet7.Name)).Select

--
regards,
Tom Ogilvy


"Dean" wrote in message
...
I am hoping that someone is experienced in using the Sheet CodeNames when
selecting Multiple Sheets. I know that you can use Sheet5.Select to go to
sheet 5, even though the sheet may have been renamed by the user, sheet 5
remains constant in Properties. I can select multiple sheets, using
Sheets(Array("MySheet", "YourSheet", "ThereSheet")).Select. But, I want
to
be able to use the CodeName instead, I'm unable to find any references to
doing so. By using the CodeName, I wouldn't have to track the changes in
the
user applied sheet names. Can anyone help me on this? I appreciate it.
Dean





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Using CodeName when Selecting Multi-Tabs

Not sure why you need to involve codenames if you only want to select sheets
1 to 17. Maybe somehting like this will do

Dim i as long
Redim arr(1 To 17)
For i = 1 To Ubound(arr)
arr(i) = i
Next
Sheets(arr).select

Regards,
Peter T


"merry_fay" wrote in message
...
Hi,

This si just what I'm looking for, but is there a shorter way of writing
it?

I need to select sheets 1 to 17 which becomes a lengthy bit of code!

Thanks
merry_fay

"Dean" wrote:

Thanks Tom, very much. Dean

"Tom Ogilvy" wrote:

sheets(array(Sheet1.Name, Sheet5.Name, Sheet7.Name)).Select

--
regards,
Tom Ogilvy


"Dean" wrote in message
...
I am hoping that someone is experienced in using the Sheet CodeNames
when
selecting Multiple Sheets. I know that you can use Sheet5.Select to
go to
sheet 5, even though the sheet may have been renamed by the user,
sheet 5
remains constant in Properties. I can select multiple sheets, using
Sheets(Array("MySheet", "YourSheet", "ThereSheet")).Select. But, I
want
to
be able to use the CodeName instead, I'm unable to find any
references to
doing so. By using the CodeName, I wouldn't have to track the
changes in
the
user applied sheet names. Can anyone help me on this? I appreciate
it.
Dean





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
Simple ? countif, 3 separate conditions across multi tabs Steve Excel Worksheet Functions 8 January 3rd 09 05:59 AM
Can Pivot tabel be linked to multi-tabs? yhoy Excel Discussion (Misc queries) 1 December 12th 08 09:38 PM
Selecting a subset of data from multi columns Al Excel Discussion (Misc queries) 1 May 7th 08 08:20 PM
Selecting a sheet by codename Dr.Schwartz Excel Programming 3 September 3rd 04 02:15 PM
Multi Check Boxes (Selecting Just One) Kirk Lewis Excel Programming 5 August 2nd 04 01:41 AM


All times are GMT +1. The time now is 10:25 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"