ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   search over range of worksheets (https://www.excelbanter.com/excel-programming/360917-search-over-range-worksheets.html)

Kanga 85

search over range of worksheets
 
I have 30 worksheets in the workbook, but I only want to search from "alpha"
to "queen" (putting various results in "Results").
How do I program for each worksheet form "alpha" to "queen"?
'For each ws in Thisworkbook.Worksheets ....'

(note: I have a changing number of worksheets between "alpha" and "queen" so
I cannot use 'worksheets.count')

Thanks

Ardus Petus

search over range of worksheets
 
for iWS = worksheets("alpha").index to worksheets("queen").index
set ws = worksheets(i)
next i

HTH
--
AP

"Kanga 85" a écrit dans le message de
news: ...
I have 30 worksheets in the workbook, but I only want to search from
"alpha"
to "queen" (putting various results in "Results").
How do I program for each worksheet form "alpha" to "queen"?
'For each ws in Thisworkbook.Worksheets ....'

(note: I have a changing number of worksheets between "alpha" and "queen"
so
I cannot use 'worksheets.count')

Thanks




Kanga 85

search over range of worksheets
 
Thanks Ardus Petrus

"Ardus Petus" wrote:

for iWS = worksheets("alpha").index to worksheets("queen").index
set ws = worksheets(i)
next i

HTH
--
AP

"Kanga 85" a écrit dans le message de
news: ...
I have 30 worksheets in the workbook, but I only want to search from
"alpha"
to "queen" (putting various results in "Results").
How do I program for each worksheet form "alpha" to "queen"?
'For each ws in Thisworkbook.Worksheets ....'

(note: I have a changing number of worksheets between "alpha" and "queen"
so
I cannot use 'worksheets.count')

Thanks






All times are GMT +1. The time now is 11:51 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com