Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

It seems to me that your SHEETNAME() is

Function SheetName(Optional nSheet)
If IsMissing(nSheet) Then
    SheetName = ThisComponent.getCurrentController().getActiveSheet().getName()
Else
    SheetName = ThisComponent.getSheets().getByIndex(nSheet-1).getName()
EndIf
End Function