ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Using Worksheet Name (https://www.excelbanter.com/excel-worksheet-functions/260905-using-worksheet-name.html)

Akhil Goel

Using Worksheet Name
 
I am having multiple worksheets in an Excel file and now I want to use the
name of each worksheet in a new worksheet in the same file.

Is there a formula which can copy the name of worksheet into a Cell of
another worksheet

Pete_UK

Using Worksheet Name
 
This article from Bob Phillips' site covers what you want:

http://www.xldynamic.com/source/xld.xlFAQ0002.html

Hope this helps.

Pete

On Apr 7, 1:49*pm, Akhil Goel
wrote:
I am having multiple worksheets in an Excel file and now I want to use the
name of each worksheet in a new worksheet in the same file.

Is there a formula which can copy the name of worksheet into a Cell of
another worksheet



Bob Phillips[_4_]

Using Worksheet Name
 

Worksheets(2).Range("A1").Value2 = Worksheets(1).Name

--

HTH

Bob

"Akhil Goel" wrote in message
...
I am having multiple worksheets in an Excel file and now I want to use the
name of each worksheet in a new worksheet in the same file.

Is there a formula which can copy the name of worksheet into a Cell of
another worksheet




Dave Peterson

Using Worksheet Name
 
Option Explicit
Sub testme()

Dim iCtr As Long
Dim rCtr As Long

rCtr = 0
For iCtr = 1 To Sheets.Count
If Worksheets(iCtr).Name = Worksheets("NewWorksheetname").Name Then
'skip it
Else
rCtr = rCtr + 1
With Worksheets("NewWorksheetname")
With .Cells(rCtr, "A")
.NumberFormat = "@" 'text
.Value = Sheets(iCtr).Name
End With
End With
End If
Next iCtr

End Sub



Akhil Goel wrote:

I am having multiple worksheets in an Excel file and now I want to use the
name of each worksheet in a new worksheet in the same file.

Is there a formula which can copy the name of worksheet into a Cell of
another worksheet


--

Dave Peterson


All times are GMT +1. The time now is 11:41 AM.

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