Hi -
I am trying to write a code that allows me to add all
worksheet names into an array.
My array is defined as:
Dim SheetName (20) as String
I tried the following code but it doesn't seem to work:
For z = 1 to SheetCount
SheetName(z) = xlswb.Worksheets.Add
Next z
I am trying to look for a command that reads each 'tab' in
a workbook and 'sends' the name of each worksheet to my
array.
Please help.
Thanks
Ken Snell [MVP] - 22 Sep 2004 16:04 GMT
Change
SheetName(z) = xlswb.Worksheets.Add
to
SheetName(z) = xlswb.Worksheets(z).Name

Signature
Ken Snell
<MS ACCESS MVP>
> Hi -
>
[quoted text clipped - 19 lines]
>
> Thanks