Load an array with Sheet names
I am not too sure why you would like to load an array with the sheet names.
The sheets are a collection and the names can be accessed with a for next
loop.
dim wks as worksheet
for each wks in worksheets
msgbox wks.name
next wks
If you still need the array you can populate it from within the loop... but
I am not sure that it is necessary.
HTH
"S G Booth" wrote:
varr is a Variant array. I wish to load it with names of sheets in the
activeworkbook.
I have:
If Global_PrintAllBooks_Sheets = True Then
ReDim varr(1 To Worksheets.Count)
For i = 1 To UBound(varr)
varr(i) = ws.Name
i = i + 1
Next
I receive run time error 91 (Object variable or With block variable not set)
on varr(i) = ws.Name
Why is this please?
Regards.
|