Extract Sheet Names

venumkd

New Member
Joined
Feb 4, 2020
Messages
44
Office Version
  1. 2010
Sirs,

I need a method or VBA to extract or list sheet names of a workbook into a worksheet.

The workbook contains around 5000 sheets named not in a particular order. These sheet names are to be extracted / entered or listed to Sheet1 of the workbook in any of the columns preferably in Column A.

Thanks & Regards.

VENU
 

Some videos you may like

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
48,400
Office Version
  1. 365
Platform
  1. Windows
Try

VBA Code:
Sub List_Worksheets()
  Dim ws As Worksheet
  Dim i As Long
  
  For Each ws In Worksheets
    i = i + 1
    Sheets("Sheet1").Range("A" & i).Value = ws.Name
  Next ws
End Sub
 

sandy666

Banned - Rules violations
Joined
Oct 24, 2015
Messages
7,499
with Power Query
Rich (BB code):
let
    Source = Excel.Workbook(File.Contents("full_path_to_your_file"), null, true),
    TSC = Table.SelectColumns(Table.SelectRows(Source, each ([Kind] = "Sheet")),{"Name"})
in
    TSC
 
Last edited:

Rick Rothstein

MrExcel MVP
Joined
Apr 18, 2011
Messages
36,873
Office Version
  1. 2010
Platform
  1. Windows
5000 worksheets! Really, 5000 of them? I cannot imagine what your tabs must look like. Anyway, although I haven't tested it on such a huge number of worksheet, I think it should work... you might find my "Neat Go To Sheet" selector to be of some interest. Here is a link to my mini-blog article where I introduced it...

A Neat "Go To Sheet" Selector
.
 

KevCarter

Board Regular
Joined
Dec 7, 2013
Messages
145
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS

ADVERTISEMENT

5000 worksheets! Really, 5000 of them? I cannot imagine what your tabs must look like. Anyway, although I haven't tested it on such a huge number of worksheet, I think it should work... you might find my "Neat Go To Sheet" selector to be of some interest. Here is a link to my mini-blog article where I introduced it...

A Neat "Go To Sheet" Selector
.

Some very nice code Rick. Thank you for sharing, I'll learn a lot from it. Cheers!
 

Watch MrExcel Video

Forum statistics

Threads
1,127,590
Messages
5,625,674
Members
416,125
Latest member
NeedExcelHelp2021

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