Ideally I want to have some kind of formula that will list all my sheets.
If possible to be dynamic so when I add / rename / move a sheet to a different location the list would update.
I have found these two things one is using VBA and the other is without.
I cannot get either to work as for the VBA I do not know how calc references sheets,
in th VBA code it is workbook.
These are both for MS Office and I do not know how to convert them
Extract a list of sheet names in your workbook without using a macro
Go to FORMULAS tab and click on Define Name. Fill in the box as shown below:
The function used is “=replace(get.workbook(1),1,find("]",get.workbook(1))," ")”
Then wherever you want the list of sheet names, simply type in this formula:
=INDEX(sheetlist,ROW())
It will show you names of the sheets in each cell. Drag the formula down to complete the list of sheets in the workbook.
This is the VBA way
You can do this only with VBA code. There is no worksheet function to get sheet names. (although there is I found one listed above)
Sub ListSheetNames()
Dim R As Range
Dim WS As Worksheet
Set R = ActiveCell
For Each WS In ThisWorkbook.Worksheets
R.Value = WS.Name
Set R = R(2, 1)
Next WS
End Sub
Select the cell where the list should start and run the code above.
I also found this VBA
Sub ListWorkSheetNamesNewWs()
'Updateby20140624
Dim xWs As Worksheet
On Error Resume Next
Application.DisplayAlerts = False
xTitleId = “KutoolsforExcel”
Application.Sheets(xTitleId).Delete
Application.Sheets.Add Application.Sheets(1)
Set xWs = Application.ActiveSheet
xWs.Name = xTitleId
For i = 2 To Application.Sheets.Count
xWs.Range(“A” & (i - 1)) = Application.Sheets(i).Name
Next
Application.DisplayAlerts = True
End Sub