Gord Dibben wrote...
Private Subs are not listed in Tools>Macro>Macros because they
are.........Private and not for viewing by snoops.
Since all procedure names are visible when viewing XLS files with a hex
editor, Private only prevents viewing by the village idiots, not
dedicated and knowledgeable snoops.
That said, better to make the procedure a function which could return
the list of worksheet names either as an array or as a long text
string. Much, much more flexible.
Function wslst(Optional rettxt As Boolean = False) As Variant
Dim rv As Variant, k As Long, wsc As Sheets
If TypeOf Application.Caller Is Range Then
Set wsc = Application.Caller.Parent.Parent.Sheets
Else
Set wsc = ActiveWorkbook.Sheets
End If
If Not rettxt Then ReDim rv(1 To wsc.Count, 1 To 1)
For k = 1 To wsc.Count
If rettxt Then
rv = rv & vbLf & wsc(k).Name
Else
rv(k, 1) = wsc(k).Name
End If
Next k
If rettxt Then
wslst = Mid(rv, 2)
Else
wslst = rv
End If
End Function