View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Copy sheet problem


Actually that just raises an error because of your improper use of
parentheses around the Range("A1").

--
Regards,
Tom Ogilvy

"Paulw2k" wrote in message
...
Hi SiriS,

This should solve it.

Sub CopyToTopSheet()
Dim Rng As Range

Sheets.Add Befo=Sheets(1)
Set Rng = Sheets("MySheet").Cells
Rng.Copy (Range("A1")) 'of the sheet just added.

End Sub

Regards

Paul




"SiriS " wrote in message
...
Hello,
I've got the run-time error "Copy method of worksheet class failed",
and is trying to use the MSDN workaround for this problem(see


http://support.microsoft.com/default...4&Product=xlw).

But in the MSDN workaround they only copy cells, I want to copy
everything in the sheet, format also.

Sheets.Add Befo=Sheets(1)
Sheets("Mysheet").Cells.Copy
Sheets(ActiveSheet.Name).Paste

How to copy everything in the sheet?

Thank you.

SiriS


---
Message posted from http://www.ExcelForum.com/