Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA Worksheets() term

Hi all,

Is there anyway I can reference all sheets in the workbook, or eithe
all sheets in between (sheets that i've named) "Top" and "Bottom" usin
the Worksheets() term in vba?

I know that i can use the Sheets(Array("Sheet1", "Sheet2", ...)) ter
but that's not gonna fly in this case cause the work book is update
daily and i can't reference specific sheets unless it's something lik
every sheet between "this sheet" to "that sheet".

Thx :

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default VBA Worksheets() term

Dim i As Long
Dim ary

ReDim ary(Worksheets.Count - 1)
For i = 1 To Worksheets.Count
ary(i - 1) = Worksheets(i).Name
Next i
Worksheets(ary).Select


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"abxy " wrote in message
...
Hi all,

Is there anyway I can reference all sheets in the workbook, or either
all sheets in between (sheets that i've named) "Top" and "Bottom" using
the Worksheets() term in vba?

I know that i can use the Sheets(Array("Sheet1", "Sheet2", ...)) term
but that's not gonna fly in this case cause the work book is updated
daily and i can't reference specific sheets unless it's something like
every sheet between "this sheet" to "that sheet".

Thx :)


---
Message posted from http://www.ExcelForum.com/



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
How can I filter by term digits Dyan Excel Discussion (Misc queries) 4 December 13th 13 04:09 PM
What would the term be???? doss04 Excel Discussion (Misc queries) 3 November 20th 08 12:45 PM
official term for the -- operator? Dave F Excel Discussion (Misc queries) 11 February 28th 07 12:34 AM
Help with GUI (for lack of a better term) Mike in Saukville Excel Discussion (Misc queries) 1 February 21st 07 09:55 PM
Calculate Term Anita Excel Worksheet Functions 3 December 21st 05 04:27 AM


All times are GMT +1. The time now is 11:53 PM.

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

About Us

"It's about Microsoft Excel"