View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Jim Thomlinson Jim Thomlinson is offline
external usenet poster
 
Posts: 5,939
Default Public Function Question

This might be a silly question but what were you wanting the function to do.
The function itself works just fine. How were you intending to use it? Were
you intending to use this as a user defined function (use it as a fromula in
a spreadsheet cell)?
--
HTH...

Jim Thomlinson


"carl" wrote:

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.