Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Retrieving all worksheet names into a new worksheet

I'd like to retrieve all worksheet names (I have 30 in one workbook) and
list them on a separate worksheet. I've used a macro in the past which did
this, but I'm unable to locate it. Can someone assist?

Thanks in advance,
Barb Reinhardt
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 709
Default Retrieving all worksheet names into a new worksheet

Barb, give this a try,

Sub List_All_Sheets()

Dim Rng As Range

Dim i As Integer

Worksheets.Add

Set Rng = Range("A1")

For Each Sheet In ActiveWorkbook.Sheets

Rng.Offset(i, 0).Value = Sheet.Name

i = i + 1

Next Sheet

End Sub
--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003


"Barb Reinhardt" wrote in message
...
I'd like to retrieve all worksheet names (I have 30 in one workbook) and
list them on a separate worksheet. I've used a macro in the past which
did
this, but I'm unable to locate it. Can someone assist?

Thanks in advance,
Barb Reinhardt



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Retrieving all worksheet names into a new worksheet

That did it, thanks!

"Paul B" wrote:

Barb, give this a try,

Sub List_All_Sheets()

Dim Rng As Range

Dim i As Integer

Worksheets.Add

Set Rng = Range("A1")

For Each Sheet In ActiveWorkbook.Sheets

Rng.Offset(i, 0).Value = Sheet.Name

i = i + 1

Next Sheet

End Sub
--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003


"Barb Reinhardt" wrote in message
...
I'd like to retrieve all worksheet names (I have 30 in one workbook) and
list them on a separate worksheet. I've used a macro in the past which
did
this, but I'm unable to locate it. Can someone assist?

Thanks in advance,
Barb Reinhardt




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 709
Default Retrieving all worksheet names into a new worksheet

Your welcome
--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

"Barb Reinhardt" wrote in message
...
That did it, thanks!

"Paul B" wrote:

Barb, give this a try,

Sub List_All_Sheets()

Dim Rng As Range

Dim i As Integer

Worksheets.Add

Set Rng = Range("A1")

For Each Sheet In ActiveWorkbook.Sheets

Rng.Offset(i, 0).Value = Sheet.Name

i = i + 1

Next Sheet

End Sub
--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003


"Barb Reinhardt" wrote in
message
...
I'd like to retrieve all worksheet names (I have 30 in one workbook)
and
list them on a separate worksheet. I've used a macro in the past
which
did
this, but I'm unable to locate it. Can someone assist?

Thanks in advance,
Barb Reinhardt






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 123
Default Retrieving all worksheet names into a new worksheet

Great code,

But along with the sheet name if i wish to get cell vaule "c10" then?

I need this as i have to check about 250 sheets. please help, us macro can
solve my purpose.

Thanks!


"Paul B" wrote:

Barb, give this a try,

Sub List_All_Sheets()

Dim Rng As Range

Dim i As Integer

Worksheets.Add

Set Rng = Range("A1")

For Each Sheet In ActiveWorkbook.Sheets

Rng.Offset(i, 0).Value = Sheet.Name

i = i + 1

Next Sheet

End Sub
--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003


"Barb Reinhardt" wrote in message
...
I'd like to retrieve all worksheet names (I have 30 in one workbook) and
list them on a separate worksheet. I've used a macro in the past which
did
this, but I'm unable to locate it. Can someone assist?

Thanks in advance,
Barb Reinhardt






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Retrieving all worksheet names into a new worksheet

Adding a new worksheet for listing worksheet names & cell C10 values, adding
the worksheet names in Column A and adding the value in cell C10 in column B
for every worksheet in the workbook.

-------------------------------------
Sub List_All_SheetNames()
Dim Rng As Range
Dim i As Integer
Worksheets.Add
Cells(1, 1).Value = "Worksheet Names"
Cells(1, 2).Value = "Cell C10"
Set Rng = Range("A2")

For Each Sheet In ActiveWorkbook.Sheets
Rng.Offset(i, 0).Value = Sheet.Name
Rng.Offset(i, 1).Value = Worksheets(Sheet.Name).Range("C10").Value
i = i + 1
Next Sheet
Columns("A:B").EntireColumn.AutoFit
End Sub
--------------------------
hth,
Jim K


"Boss" wrote:

Great code,

But along with the sheet name if i wish to get cell vaule "c10" then?

I need this as i have to check about 250 sheets. please help, us macro can
solve my purpose.

Thanks!




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
Retrieving data into worksheet from another worksheet in same work Tasha Excel Discussion (Misc queries) 2 August 6th 09 03:51 PM
Retrieving Worksheet Name Jim A Excel Discussion (Misc queries) 2 March 26th 06 11:57 PM
How to link Excel worksheet tab names to dates in each worksheet? Pat Excel Worksheet Functions 9 January 31st 05 07:51 AM
copy range on every worksheet (diff names) to a master worksheet (to be created) Bernie[_2_] Excel Programming 2 September 22nd 04 03:30 PM
copy range on every worksheet (diff names) to a master worksheet (to be created) Bernie[_3_] Excel Programming 0 September 22nd 04 03:26 PM


All times are GMT +1. The time now is 12:48 PM.

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

About Us

"It's about Microsoft Excel"