Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How name a copied worksheet?

I was given this code to copy a worksheet to another:

Activesheet.copy After:=ActiveSheet


How do I give the new worksheet a name rather than it
using the same name with a number in parentheses after it?

- David



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default How name a copied worksheet?

David,

The new sheet is the active sheet after a Copy operation, so you
can use ActiveSheet. E.g.,

ActiveSheet.Name = "NewName"



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"David" wrote in message
...
I was given this code to copy a worksheet to another:

Activesheet.copy After:=ActiveSheet


How do I give the new worksheet a name rather than it
using the same name with a number in parentheses after it?

- David





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default How name a copied worksheet?

Hi David

Name it "Harald". Great norwegian name, done like this:

Sub test()
On Error Resume Next
ActiveSheet.Copy After:=ActiveSheet
ActiveSheet.Name = "Harald"
End Sub

-yes, it's a separate operation. I think it has to be that way.
--
HTH. Best wishes Harald
Excel MVP

Followup to newsgroup only please.

"David" wrote in message ...
I was given this code to copy a worksheet to another:

Activesheet.copy After:=ActiveSheet


How do I give the new worksheet a name rather than it
using the same name with a number in parentheses after it?

- David





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
Getting a value from another worksheet, in a copied cell? [email protected] Excel Worksheet Functions 4 January 13th 09 07:04 PM
Can data be copied from one worksheet to another? TinaF[_2_] Excel Worksheet Functions 2 December 18th 08 03:50 PM
how do i restore a copied over worksheet ewj100 Excel Worksheet Functions 0 November 24th 07 01:38 AM
Copied worksheet not working [email protected] Excel Discussion (Misc queries) 0 June 15th 06 08:01 PM
How to protect a worksheet from being copied to another worksheet SurvivorIT Excel Discussion (Misc queries) 3 August 31st 05 01:53 PM


All times are GMT +1. The time now is 07:56 PM.

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"