View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default Public Function Question

What do you want it to do, it creates an array of sheetnames as it should.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"carl" wrote in message
...
I was pointed to this macro:

Public Function AllSheetNames()
Dim Arr() As String
Dim I As Integer
ReDim Arr(Sheets.Count - 1)
For I = 0 To Sheets.Count - 1
Arr(I) = Sheets(I + 1).Name
Next I
AllSheetNames = Arr ' return a row array OR
AllSheetNames = Application.WorksheetFunction.Transpose(Arr)
' return a column array
End Function

I can't seem to get it to work in my workbook.

Can someone walk me through the steps.

Thank you in advance.