LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Worksheet arrays VBA

I'm trying to progamitically select a group of sheets with "CC" as part of
the name, they are always in one block but may vary in the collection of
sheets. I can find their start and finish index no's but how do I use this
in the "Sheets.Array" command - see code below.

Sub Test()
Dim WKS
Dim intStart As Byte
Dim intEnd As Byte
Dim intcnt As Byte

intStart = 0
intEnd = 0

For Each WKS In Worksheets
If InStr(UCase(WKS.Name), "CC") 0 Then
If intStart = intEnd Then
intStart = WKS.Index
Else
intEnd = WKS.Index
End If
End If
Next

MsgBox "Start = " & intStart & " End = " & intEnd

For intcnt = intStart To intEnd

'now how to I program this with the above info?????
Sheets(Array("cc-1", "cc-2", "cc-3", "cc-4")).Select

Next

End Sub

 
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
Array function, two dimensions?? and worksheet arrays Neal Zimm Excel Programming 7 October 3rd 05 09:16 PM
Linking arrays and Worksheet names gsimmons2005 Excel Worksheet Functions 2 August 18th 05 04:54 PM
Worksheet names to variant arrays Alasdair Stirling[_3_] Excel Programming 3 August 3rd 05 01:48 PM
Using Excel Worksheet functions in Arrays The Roon Excel Programming 1 January 13th 05 05:05 AM


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