PC Review


Reply
Thread Tools Rate Thread

Copy a Sheet & Rename based on Cell Value Q

 
 
Sean
Guest
Posts: n/a
 
      7th Sep 2007
I am trying to copy an active sheet to a new sheet and rename based on
the value in A1 (which has a formula that produces a value of ..
"London 07-09-07 12:30", but I'm getting debug on line

ActiveSheet.Name = Range("A1").Value

I guess its the way A1 is formatted, how can I do this?

Thanks


Sub Copy_Rename()
Dim shtName As String
shtName = ActiveSheet.Name
ActiveSheet.Copy after:=ActiveSheet
ActiveSheet.Name = Range("A1").Value
Sheets(shtName).Activate

etc etc

End Sub

 
Reply With Quote
 
 
 
 
Jim Cone
Guest
Posts: n/a
 
      7th Sep 2007

The colon character ":" is not allowed in a sheet name.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"Sean" <(E-Mail Removed)>
wrote in message
I am trying to copy an active sheet to a new sheet and rename based on
the value in A1 (which has a formula that produces a value of ..
"London 07-09-07 12:30", but I'm getting debug on line

ActiveSheet.Name = Range("A1").Value
I guess its the way A1 is formatted, how can I do this?
Thanks

Sub Copy_Rename()
Dim shtName As String
shtName = ActiveSheet.Name
ActiveSheet.Copy after:=ActiveSheet
ActiveSheet.Name = Range("A1").Value
Sheets(shtName).Activate
etc etc
End Sub
 
Reply With Quote
 
Sean
Guest
Posts: n/a
 
      7th Sep 2007
On Sep 7, 12:48 pm, "Jim Cone" <jim.cone...@rcn.comXXX> wrote:
> The colon character ":" is not allowed in a sheet name.
> --
> Jim Cone
> San Francisco, USAhttp://www.realezsites.com/bus/primitivesoftware
> (Excel Add-ins / Excel Programming)
>
> "Sean" <seanrya...@yahoo.co.uk>
> wrote in message
> I am trying to copy an active sheet to a new sheet and rename based on
> the value in A1 (which has a formula that produces a value of ..
> "London 07-09-07 12:30", but I'm getting debug on line
>
> ActiveSheet.Name = Range("A1").Value
> I guess its the way A1 is formatted, how can I do this?
> Thanks
>
> Sub Copy_Rename()
> Dim shtName As String
> shtName = ActiveSheet.Name
> ActiveSheet.Copy after:=ActiveSheet
> ActiveSheet.Name = Range("A1").Value
> Sheets(shtName).Activate
> etc etc
> End Sub


Thanks Jim, of course

 
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
copy rows from one Data sheet to another sheet based on cell conte John McKeon Microsoft Excel Misc 2 15th May 2010 06:49 AM
rename active sheet based on cell burl_h Microsoft Excel Programming 2 13th Mar 2009 11:37 PM
Help: auto-copy entire rows from 1 sheet (based on cell criteria) to another sheet. bertbarndoor Microsoft Excel Programming 4 5th Oct 2007 04:00 PM
How can I copy sheet, fill in cell from list and rename worksheet? radlee@progressivetel.com Microsoft Excel Programming 5 31st Jul 2006 07:44 AM
Rename sheet tab based on value in a cell Dr.Indera Microsoft Excel Misc 5 7th Dec 2003 12:30 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:51 PM.