VB Code to List all Sheets and Charts in a Workbook

  • Thread starter Thread starter rmellison
  • Start date Start date
R

rmellison

I have a large workbook, which needs a 'Summary Sheet' listing all the tabs
in the sheet at the beginning. The tab names change quite often, and new ones
are added; so, using VB, how do I list all the tab names in order in a range
within the first sheet? Some of the sheets are actually Charts within their
own tab - so I need to make sure that I capture all of these also.

Thanks in advance...
 
Hi Rmellison

Try the below code

Sub Test()
Dim sh
Sheets.Add
For sh = 1 To Sheets.Count
Cells(sh, 1) = Sheets(sh).Name
Next sh
End Sub
 
Back
Top