Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 519
Default 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.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 519
Default 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.




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
Create new workbook and new worksheet and close. Worksheet not sav Patrick Djo Excel Worksheet Functions 0 July 20th 09 07:10 PM
Macro to Create New Worksheet and Reference Cell in Old Worksheet As Tab Name - "Object Required" Error [email protected] Excel Discussion (Misc queries) 4 September 25th 06 01:35 PM
Can I create a worksheet menu to select each other worksheet pippagrace Excel Discussion (Misc queries) 4 June 23rd 06 01:28 PM
How do I create a worksheet within a worksheet in Excel? Julieee Excel Worksheet Functions 1 December 23rd 05 01:33 AM
Using VBA to create a new worksheet, and then target new worksheet brianproctorla Excel Discussion (Misc queries) 1 September 27th 05 12:50 AM


All times are GMT +1. The time now is 10:42 AM.

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"