VB Code to List all Sheets and Charts in a Workbook

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...
 
R

Ranjit kurian

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top