List of Worksheets

doug.washburn

New Member
Joined
May 18, 2004
Messages
49
Hello,

I have a workbook with dozens of worksheets inside it all with unique names.
I need to export a list of these worksheets to another document Like another Excel workbook).

I know how to get a list of the tabs from the properties>contents window, but I can't select them all to copy and paste.

Any ideas?
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
This will create a list of sheets in a new workbook:

Code:
Sub listsheets()
Dim i As Long, wb As Workbook, ws As Worksheet
Set wb = Workbooks.Add
For Each ws In ThisWorkbook.Worksheets
    i = i + 1
    wb.Sheets("Sheet1").Cells(i, 1).Value = ws.Name
Next ws
End Sub
 
Upvote 0

hkruiniger

New Member
Joined
Oct 21, 2013
Messages
5
Great idea, but I'm clearly not doing it right. I get a code snippet called something like FUNCRES.XSLAM, and when I run it I get "RES" in cell A1, nothing else....

???

Hans
 
Upvote 0

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
Press ALT +F11, from trhe Insert menu select Module. Paste the code into the white space on the right. Press ALT + Q.

Press ALT F8, double click listsheets.
 
Upvote 0

Forum statistics

Threads
1,190,745
Messages
5,982,713
Members
439,791
Latest member
NwaTech_

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top