Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default add new named sheet

I want to add a worksheet to the workbook with a specific
name that is in a cell on an existing worksheet.
How can this be done??

Thanx ahead,
G. Carter
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default add new named sheet

One way:

Option Explicit
Sub testme01()

Dim newWks As Worksheet

Set newWks = Worksheets.Add
On Error Resume Next
newWks.Name = Worksheets("sheet1").Range("a1").Value
If Err.Number < 0 Then
MsgBox "couldn't rename sheet: " & newWks.Name
Err.Clear
End If
On Error Goto 0

End Sub



GREG CARTER wrote:

I want to add a worksheet to the workbook with a specific
name that is in a cell on an existing worksheet.
How can this be done??

Thanx ahead,
G. Carter


--

Dave Peterson

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default add new named sheet

Worksheets.Add(After:=worksheets( _
worksheets.count)).Name = Activesheet.Range("B9").Value

or
sName = Activesheet.Range("B9").Value
Worksheets.Add(After:=worksheets(worksheets.count) )
Activesheet.Name = sName


--
Regards,
Tom Ogilvy



GREG CARTER wrote in message
...
I want to add a worksheet to the workbook with a specific
name that is in a cell on an existing worksheet.
How can this be done??

Thanx ahead,
G. Carter



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
problem finding named sheet Patricia D Excel Discussion (Misc queries) 1 December 7th 09 10:49 PM
Move a particular named sheet to the end. Ann New Users to Excel 2 April 12th 07 11:54 AM
same Named cells in different sheet Pierre Excel Discussion (Misc queries) 5 August 19th 05 08:16 AM
Create a sheet name, won't let me, says already sheet named that Buckwheat Excel Worksheet Functions 7 May 2nd 05 12:55 AM
referencing a sheet named in a cell then using data from that sheet gbeard Excel Worksheet Functions 4 April 15th 05 08:42 AM


All times are GMT +1. The time now is 08:29 AM.

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

About Us

"It's about Microsoft Excel"