View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Bjoern[_3_] Bjoern[_3_] is offline
external usenet poster
 
Posts: 4
Default Copy and Remame Sheet in active Workbook

Hello and thank you very much also about the extra hint.

regards
Bjoern

FSt1 schrieb:
hi,
somthing lilke this should do it.
Sheets("SomeSheet").select
Cells.Copy
Sheets.Add
ActiveSheet.Paste
Sheets("Sheet2").Name = "New name"

note: the new sheet will take the number of the next sheet number by default
untill you give it a name. even after giving it a name, you can still
reference the sheet by it's number in vb code. deleting sheets does not shift
numbers instead you have a gap in the sheet numbering. this can get tricky.

Regards
FSt1

"Bjoern" wrote:

Hello,

I found many examples how to copy a sheet form one workbook to an other
in this newsgroup. But I want to copy a sheet (including all Data,
formating an formulas) and paste in with a new name to the same
(active) workbook.

Can you tell me how to do this in vba?

regards
Bjoern