Error with Activecell.paste

  • Thread starter Thread starter Rich
  • Start date Start date
R

Rich

I am using Excel 97.

I had a macro that has been working for the longest time. I have not
changed anything. This is the problem.

The code copy several rows of data from one spreadsheet. Then goes to
a new spreadsheet. Then click on a single cell in the new sheet. The
macro issues the command :

ActiveSheet.paste

The macro crashes.

I have tried to pick a range that is the same size as the area that I
am trying to paste. That did not work. I tried picking a single cell.
That did not work.

What can I do to fix this ???
 
Hi Rich,

The following copies a range (A1:P20) from Sheet1 to a range anchored on A1
in Sheet2:

Sub Tester02()
Dim RngSrc As Range
Dim Rngdest As Range

With ActiveWorkbook
Set RngSrc = .Sheets("Sheet1").Range("A1:P20")
Set Rngdest = .Sheets("Sheet2").Range("A1")
End With

RngSrc.Copy Rngdest

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top