Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Copying cells between sheets

Hi!

When I try to write this command in a macro :

sheets("S1").range("A5:E5).copy (sheets("S2").range("A10:E20"))

occurs an Error "Run-time error '1004': Impossible to execute the copy
method in range class". It seems to me the copy command only works well when
target sheet is the current sheet, I think... (It works when I try to copy to
the sheet where the code is executed) :(
Is there a way to do this? I need to copy the value and the format os the
cells in the range...

Thanks
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Copying cells between sheets

It probably don't like the missing quote mark and second set of Parentheses.
Try:

Sheets("S1").Range("A5:E5").copy Sheets("S2").Range("A10")

You only need a reference cell in the top left of the range you want to
paste to.

"Mark Hezz" wrote:

Hi!

When I try to write this command in a macro :

sheets("S1").range("A5:E5).copy (sheets("S2").range("A10:E20"))

occurs an Error "Run-time error '1004': Impossible to execute the copy
method in range class". It seems to me the copy command only works well when
target sheet is the current sheet, I think... (It works when I try to copy to
the sheet where the code is executed) :(
Is there a way to do this? I need to copy the value and the format os the
cells in the range...

Thanks

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Copying cells between sheets

I found a solution:

sheets("Sheet1").Range("A5:E5").copy Destination:=
sheets("Sheet2").Range("A10")

In this form, it works in my MS Excel 2003.

Thanks All
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
Copying cells between sheets in a workbook Rick Excel Discussion (Misc queries) 2 November 21st 08 01:55 PM
copying text on sheet 1 to corresponding cells on sheets 2 to 5 Lisa New Users to Excel 5 October 1st 08 06:01 AM
HAVE ONE REPORT SHEET WITH LINKS FROM VARIOUS SHEETS. ON COPYING THIS LINKED SHEET FOR EXPORTING IT TO THE OFFICE GET ERRORS IN CELLS. HOW TO RESOLVE THIS? CAPTGNVR Excel Programming 4 February 17th 07 06:12 PM
copying the same cells from many sheets t.o. Excel Worksheet Functions 3 February 16th 06 10:35 PM
Macro copying cells between sheets cbrd[_14_] Excel Programming 6 January 5th 06 10:58 PM


All times are GMT +1. The time now is 09:03 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"