ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Create 2nd, 3rd , 4th worksheet and so on (https://www.excelbanter.com/excel-programming/337448-create-2nd-3rd-4th-worksheet-so.html)

Steved

Create 2nd, 3rd , 4th worksheet and so on
 
Hello from Steved

I pickup the below from the newsgroup.

Please how to I add the extra worksheets another 8. I will name them
Roskill, Papakura, Wiri, Shore, Orewa, Swanson, Panmure and Waiheke.

Sub AddNameNewSheet2()
Dim CurrentSheetName As String
CurrentSheetName = ActiveSheet.Name
Sheets.Add
On Error Resume Next
ActiveSheet.Name = "City"
Do Until Err.Number = 0
Err.Clear
Loop
On Error GoTo 0
Sheets(CurrentSheetName).Select
End Sub
Thankyou.


Bob Phillips[_6_]

Create 2nd, 3rd , 4th worksheet and so on
 
Worksheets.Add.Name = "Roskill"
Worksheets.Add.Name = "Papakura"
Worksheets.Add.Name = "Wiri"
Worksheets.Add.Name = "Shore"
Worksheets.Add.Name = "Orewa"
Worksheets.Add.Name = "Swanson"
Worksheets.Add.Name = "Panmure"
Worksheets.Add.Name = "Waiheke"

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Steved" wrote in message
...
Hello from Steved

I pickup the below from the newsgroup.

Please how to I add the extra worksheets another 8. I will name them
Roskill, Papakura, Wiri, Shore, Orewa, Swanson, Panmure and Waiheke.

Sub AddNameNewSheet2()
Dim CurrentSheetName As String
CurrentSheetName = ActiveSheet.Name
Sheets.Add
On Error Resume Next
ActiveSheet.Name = "City"
Do Until Err.Number = 0
Err.Clear
Loop
On Error GoTo 0
Sheets(CurrentSheetName).Select
End Sub
Thankyou.




Steved

Create 2nd, 3rd , 4th worksheet and so on
 
Thankyou.

"Bob Phillips" wrote:

Worksheets.Add.Name = "Roskill"
Worksheets.Add.Name = "Papakura"
Worksheets.Add.Name = "Wiri"
Worksheets.Add.Name = "Shore"
Worksheets.Add.Name = "Orewa"
Worksheets.Add.Name = "Swanson"
Worksheets.Add.Name = "Panmure"
Worksheets.Add.Name = "Waiheke"

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Steved" wrote in message
...
Hello from Steved

I pickup the below from the newsgroup.

Please how to I add the extra worksheets another 8. I will name them
Roskill, Papakura, Wiri, Shore, Orewa, Swanson, Panmure and Waiheke.

Sub AddNameNewSheet2()
Dim CurrentSheetName As String
CurrentSheetName = ActiveSheet.Name
Sheets.Add
On Error Resume Next
ActiveSheet.Name = "City"
Do Until Err.Number = 0
Err.Clear
Loop
On Error GoTo 0
Sheets(CurrentSheetName).Select
End Sub
Thankyou.






All times are GMT +1. The time now is 12:21 AM.

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