View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Simon Lloyd[_1068_] Simon Lloyd[_1068_] is offline
external usenet poster
 
Posts: 1
Default Copy/Paste Problem: Runtime error 1004


It would be good if you could post all of your code, however, try this:

Code:
--------------------
NewDataWS.Cells(i, FirstNameCol).EntireRow.Copy _
Destination:=ErrorWS.Range("B" & ErrorRow)

--------------------
How are you finding ErrorRow?, how are you defining ErrorWs? have you
set ErrorWs to be a name?, these are just some of the many reasons you
should post all of your code :)

Alan;274073 Wrote:
I also thought that copying the entire source row may be a problem
when trying to paste specifically. I tried this but got the same
error:

NewDataWS.Range(Cells(i, 1), Cells(i, ErrorLastColumn)).Copy
ErrorWS.Range(Cells(ErrorRow, 2), Cells(ErrorRow, ErrorLastColumn +
1)).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, _
SkipBlanks:=False,
Transpose:=False

I also tried:

NewDataWS.Cells(i, FirstNameCol).EntireRow.Copy
ErrorWS.Cells(ErrorRow, 2).Select
Selection.PasteSpecial Paste:=xlPasteValues,
Operation:=xlNone, _
SkipBlanks:=False,
Transpose:=False

but got "Select method of Range class failed".



--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=76369