Doex Excel do this?

M

Mike

Hi everone,

Say I have a workbook of 30 worksheets, each a worksheet has tab name
and table.

I want to create additional sheet that lists each tab name and its
table's column names!

Is this doable?

Thanks,
Mike
 
G

Gord Dibben

Assuming Table column names are in A1:J1 on each sheet.

Sub CreateListOfSheets()
Dim WS As Worksheet
Worksheets.Add(After:=Worksheets(Worksheets.Count)).Name = "List"
For I = 1 To Worksheets.Count
With Worksheets("List")
Set WS = Worksheets(I)
If WS.Name <> "List" Then
.Cells(I, 1).Value = WS.Name
.Cells(I, 2).Resize(1, 10).Value = WS.Range("A1:J1").Value
End If
End With
Next I
End Sub


Gord Dibben MS Excel MVP
 

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