PC Review


Reply
Thread Tools Rate Thread

Adding a Worksheet and Renaming

 
 
wfgfreedom@gmail.com
Guest
Posts: n/a
 
      3rd Jun 2008
I am trying to add a Working in a Macro and then renaming the
Worksheet, but Excel likes to name the Sheets 1,2,3,etc, and you don't
know what the sheet name will be to select to rename at the time you
run the Macro. The following is a simple code that I have so far:
mnth = Cells(1, 4)
Sheets.Add
Sheets("Sheet2").Select
Sheets("Sheet2").Name = mnth

Can anyone help me get a solution to this problem?

Frank
 
Reply With Quote
 
 
 
 
Corey ....
Guest
Posts: n/a
 
      3rd Jun 2008
Try:
Sub NewWks()
Sheets.Add
res = InputBox("What is the New Sheet Name?")
ActiveSheet.Name = res
End Sub

Corey....
<(E-Mail Removed)> wrote in message
news:5ebd3769-bfab-43a0-ad26-(E-Mail Removed)...
>I am trying to add a Working in a Macro and then renaming the
> Worksheet, but Excel likes to name the Sheets 1,2,3,etc, and you don't
> know what the sheet name will be to select to rename at the time you
> run the Macro. The following is a simple code that I have so far:
> mnth = Cells(1, 4)
> Sheets.Add
> Sheets("Sheet2").Select
> Sheets("Sheet2").Name = mnth
>
> Can anyone help me get a solution to this problem?
>
> Frank



 
Reply With Quote
 
wfgfreedom@gmail.com
Guest
Posts: n/a
 
      3rd Jun 2008
On Jun 2, 9:38*pm, "Corey ...." <c...@exemail.com.au> wrote:
> Try:
> Sub NewWks()
> * * Sheets.Add
> * * res = InputBox("What is the New Sheet Name?")
> * * ActiveSheet.Name = res
> End Sub
>
> Corey....<wfgfree...@gmail.com> wrote in message
>
> news:5ebd3769-bfab-43a0-ad26-(E-Mail Removed)...
>
>
>
> >I am trying to add a Working in a Macro and then renaming the
> > Worksheet, but Excel likes to name the Sheets 1,2,3,etc, and you don't
> > know what the sheet name will be to select to rename at the time you
> > run the Macro. *The following is a simple code that I have so far:
> > * *mnth = Cells(1, 4)
> > * *Sheets.Add
> > * *Sheets("Sheet2").Select
> > * *Sheets("Sheet2").Name = mnth

>
> > Can anyone help me get a solution to this problem?

>
> > Frank- Hide quoted text -

>
> - Show quoted text -


Thanks for your help.

Frank
 
Reply With Quote
 
Jim Cone
Guest
Posts: n/a
 
      3rd Jun 2008
Frank,

Dim mnth As String
mnth = Cells(1, 4).Text
Worksheets.Add before:=Worksheets(1), Count:=1
Worksheets(1).Name = mnth
--
Jim Cone
Portland, Oregon USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)




<(E-Mail Removed)>
wrote in message
I am trying to add a Working in a Macro and then renaming the
Worksheet, but Excel likes to name the Sheets 1,2,3,etc, and you don't
know what the sheet name will be to select to rename at the time you
run the Macro. The following is a simple code that I have so far:
mnth = Cells(1, 4)
Sheets.Add
Sheets("Sheet2").Select
Sheets("Sheet2").Name = mnth

Can anyone help me get a solution to this problem?
Frank
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Renaming Worksheet Noepie Microsoft Excel Programming 3 16th Nov 2008 08:59 AM
Worksheet Renaming =?Utf-8?B?RXJpYw==?= Microsoft Excel Misc 2 26th Jul 2007 02:44 PM
Worksheet Renaming JSS Microsoft Excel Discussion 6 17th Apr 2006 01:28 PM
renaming worksheet draganpi Microsoft Excel Programming 2 6th Apr 2006 12:06 PM
need help renaming a worksheet =?Utf-8?B?am9ud3lu?= Microsoft Excel Misc 2 1st Mar 2005 08:34 PM


Features
 

Advertising
 

Newsgroups
 


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