Selecting multiple sheets in an Excel workbook 
Author Message
 Selecting multiple sheets in an Excel workbook

Hello.. I'm trying to select all the excel worksheets via a visual
basic macro. The only way I can see is using an array. This is great
if I know the number and names of all the sheets ahead of time, but
how do I fill this array without knowing that ahead of time?

Thanks,
Stewart



Sat, 10 Apr 2004 05:02:48 GMT  
 Selecting multiple sheets in an Excel workbook
Even if you change the name of a worksheet excel remembers that it is
Sheet(1), Sheet(2)... etc.  Therefore I would use iNoSheets =
Worksheets.Count to find the number of sheets.  Then you can use a For
i = 1 to iNoSheets to fill your array - refering to each sheeet just
as Worksheet(i).

Regards,
Andrew

Quote:
> Hello.. I'm trying to select all the excel worksheets via a visual
> basic macro. The only way I can see is using an array. This is great
> if I know the number and names of all the sheets ahead of time, but
> how do I fill this array without knowing that ahead of time?

> Thanks,
> Stewart



Sat, 10 Apr 2004 15:19:25 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. SELECT * INTO - XL workbook Multiple sheet SQL error

2. Excel VBA: search multiple-sheets in a workbook

3. Word2000 Mail merge from selected sheet in Excel workbook

4. combine multiple excel workbooks into one workbook

5. Using Excel workbooks and sheet from Access

6. I want to email excel sheets in a workbook

7. Err 1004: Excel Workbook/Sheet Activate

8. Copy an Excel sheet without opening the workbook.

9. Somebody please help me to create an Excel Workbook w/sheets from VB4.0

10. VB or Excel VBA, accessing list of all the sheets in a workbook

11. Write to, calculate, read from Excel workbook-sheet

12. ADO Connection to Excel - Finding the sheets in a workbook

 

 
Powered by phpBB® Forum Software