ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How do I create a list (Word) of the names on Excel worksheet tabs (https://www.excelbanter.com/excel-worksheet-functions/132067-how-do-i-create-list-word-names-excel-worksheet-tabs.html)

PT[_2_]

How do I create a list (Word) of the names on Excel worksheet tabs
 
I need to create a list in Word of the names on (20) Excel worksheet tabs. I
can find the list, but I cannot copy and paste.

Philip J Smith

How do I create a list (Word) of the names on Excel worksheet tabs
 
See PUP at http://j-walk.com/ss/pup/pup6/

There is a utility for creating a "Contents Page" This creates a list of
named worksheets and adds hyperlinks.

Regards
Phil

"PT" wrote:

I need to create a list in Word of the names on (20) Excel worksheet tabs. I
can find the list, but I cannot copy and paste.


joel

How do I create a list (Word) of the names on Excel worksheet
 
Here is code that will make the list on Sheet1 starting at cell A1. You
probably don't want to remove sheet1 from the list

Sub GetWorksheetNames()

RowCount = 1

For Each MyWorksheet In ThisWorkbook.Worksheets

Worksheets("Sheet1").Range("A1").Offset(rowOffset: =RowCount,
columnOffset:=0) = MyWorksheet.Name

RowCount = RowCount + 1
Next MyWorksheet

End Sub


"Philip J Smith" wrote:

See PUP at http://j-walk.com/ss/pup/pup6/

There is a utility for creating a "Contents Page" This creates a list of
named worksheets and adds hyperlinks.

Regards
Phil

"PT" wrote:

I need to create a list in Word of the names on (20) Excel worksheet tabs. I
can find the list, but I cannot copy and paste.


Gord Dibben

How do I create a list (Word) of the names on Excel worksheet tabs
 
I would first put the list into a new worksheet then copy the list to Word.

Private Sub ListSheets()
'list of sheet names starting at A1
'first insert a new worksheet
Dim rng As Range
Dim i As Integer
Set rng = Range("A1")
For Each Sheet In ActiveWorkbook.Sheets
rng.Offset(i, 0).Value = Sheet.Name
i = i + 1
Next Sheet
End Sub


Gord Dibben MS Excel MVP

On Fri, 23 Feb 2007 04:54:31 -0800, PT wrote:

I need to create a list in Word of the names on (20) Excel worksheet tabs. I
can find the list, but I cannot copy and paste.




All times are GMT +1. The time now is 01:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com