Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 18
Default Extract the Sheet Name

D/a,
Is there any option like a function or a macro to extract the sheet names in
a excel file.
For Example: I have a Excel file with 10 Sheets names IT1,IT2,IT3,IT4... IT10
I want all these names in a seperate file/sheet in this format
A B C
1 IT1
2 IT2
3 IT3
4 IT4
5 IT5
6 IT6
7 IT7
8 IT8
9 IT9
10 IT10

Thanks in Advance
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Extract the Sheet Name

Hi,

This small macro will put them in column A of the activesheet

Sub Sheet_List()
Dim x As Long
For x = 1 To Worksheets.Count
Cells(x, 1) = Sheets(x).Name
Next
End Sub

Mike

"Vital_ar" wrote:

D/a,
Is there any option like a function or a macro to extract the sheet names in
a excel file.
For Example: I have a Excel file with 10 Sheets names IT1,IT2,IT3,IT4... IT10
I want all these names in a seperate file/sheet in this format
A B C
1 IT1
2 IT2
3 IT3
4 IT4
5 IT5
6 IT6
7 IT7
8 IT8
9 IT9
10 IT10

Thanks in Advance

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 18
Default Extract the Sheet Name

Thanks Mike

"Mike H" wrote:

Hi,

This small macro will put them in column A of the activesheet

Sub Sheet_List()
Dim x As Long
For x = 1 To Worksheets.Count
Cells(x, 1) = Sheets(x).Name
Next
End Sub

Mike

"Vital_ar" wrote:

D/a,
Is there any option like a function or a macro to extract the sheet names in
a excel file.
For Example: I have a Excel file with 10 Sheets names IT1,IT2,IT3,IT4... IT10
I want all these names in a seperate file/sheet in this format
A B C
1 IT1
2 IT2
3 IT3
4 IT4
5 IT5
6 IT6
7 IT7
8 IT8
9 IT9
10 IT10

Thanks in Advance

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 449
Default Extract the Sheet Name

Hi

With the file open, run this:

Sub SheetList()
Dim L As Long
Dim WB As Workbook
Dim Osht As Worksheet
Set WB = ActiveWorkbook
Workbooks.Add (1)
DoEvents
Set Osht = ActiveSheet
For L = 1 To WB.Sheets.Count
Osht.Cells(L, 1).Value =L
Osht.Cells(L, 2).Value = WB.Sheets(L).Name
Next
Set WB = Nothing
Set Osht = Nothing
End Sub

HTH. Best wishes Harald

"Vital_ar" wrote in message
...
D/a,
Is there any option like a function or a macro to extract the sheet names
in
a excel file.
For Example: I have a Excel file with 10 Sheets names IT1,IT2,IT3,IT4...
IT10
I want all these names in a seperate file/sheet in this format
A B C
1 IT1
2 IT2
3 IT3
4 IT4
5 IT5
6 IT6
7 IT7
8 IT8
9 IT9
10 IT10

Thanks in Advance


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Extract from one sheet to another Bcosta Excel Discussion (Misc queries) 5 July 7th 09 09:51 PM
How to extract a sheet from another? deedee Excel Discussion (Misc queries) 0 March 18th 09 10:26 PM
how to extract a sheet from another? deedee Excel Discussion (Misc queries) 2 March 18th 09 03:12 AM
Extract info from one sheet to another Kim Excel Worksheet Functions 2 March 15th 08 01:30 PM
Help me, compare 2 sheet and extract the match data into the new sheet. sweetnet Excel Discussion (Misc queries) 1 February 22nd 06 07:49 PM


All times are GMT +1. The time now is 06:09 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"