Get list worksheet names for only visible worksheets in a workbook

  • Thread starter Thread starter Juluka
  • Start date Start date
J

Juluka

Please could somebody help me with my query:

I am trying to get a list of worksheet names for only the visibl
worksheets in an open workbook
 
Hi Juluka!

See:
Dave McRitchie:
http://www.mvps.org/dmcritchie/excel/buildtoc.htm

You'll have to adapt the code to exclude Hidden worksheets and to
exclude other data in the table of contents that you don't want.

--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
(e-mail address removed)
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
 
The following macro lists the visible sheets of the active workbook in a
message box:

Sub VisibleSheets()

Dim sht As Object
Dim szList As String

For Each sht In ActiveWorkbook.Sheets
If sht.Visible = xlSheetVisible Then szList = szList & vbLf &
sht.Name
Next sht

szList = "The following sheets are visible in " & ActiveWorkbook.Name &
":" & vbLf & szList
MsgBox szList, vbInformation, "Visible Sheets"
End Sub
 
Back
Top