View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
George Nicholson[_2_] George Nicholson[_2_] is offline
external usenet poster
 
Posts: 170
Default Why it is not pasting it to the correct place?

Thanks Jim, it is working. But, I am not quite still sure why the initial
one
did not work!


because
Worksheets("Sheet2").Paste Destination:=Range("a20")
doesn't really specify a sheet for Destination. You may think it is implied,
but obviously Excel does not. Without specific instructions, Excel will
assume you mean ActiveSheet in regards to the destination (which is Sheet1).
The following would work:
Worksheets("Sheet2").Paste
Destination:=Worksheets("Sheet2").Range("a20")

HTH,
--
George Nicholson

Remove 'Junk' from return address.

"GreenInIowa" wrote in message
...
Thanks Jim, it is working. But, I am not quite still sure why the initial
one
did not work!

"Jim Thomlinson" wrote:

Give this a whirl...

Sub test1()
Worksheets("Sheet1").Range("data").Copy Worksheets("Sheet2").Range("A20")
End Sub

--
HTH...

Jim Thomlinson


"GreenInIowa" wrote:

Hi,

I have a simple code to paste some data which is in "Sheet1" to
"Sheet2".
==========
Sub test1()
Worksheets("Sheet1").Range("data").Copy
Worksheets("Sheet2").Paste Destination:=Range("a20")
End Sub
=======

Although I am clearly defining that it should paste on "Sheet2" it
nevertheless pastes on "Sheet1". Any explanation why it does not paste
on
"Sheet2"?

Thanks.