Error 1004, Application-definded or object-defined error
You can't select a cell on a sheet that isn't active:
Worksheets(strDestWorksheetName).select
Worksheets(strDestWorksheetName).Cells(lngLastRow, 1).Select
or
application.goto Worksheets(strDestWorksheetName).Cells(lngLastRow, 1)
Mirco Wilhelm wrote:
"Dave Peterson" wrote in message
...
Worksheets(strDestWorksheetame).Range(Cells(lngLas tRow, 1), _
Cells(lngLastRow + 52, 10)).PasteSpecial xlPasteAll
I'd qualify them using with/end with (to save typing):
with Worksheets(strDestWorksheetame)
.Range(.Cells(lngLastRow, 1), _
.Cells(lngLastRow + 52, 10)).PasteSpecial xlPasteAll
end with
Ok, it worked to some degree, but now it stops at this line:
Worksheets(strDestWorksheetName).Cells(lngLastRow, 1).Select
I tried putting it into the with and switch from select to activate,
replacing cells with range, but it won't work unless I activate the whole
sheet, which leaves the selection of the copied content active.
--
Dave Peterson
|