Problem on copy

  • Hi there,

    I have an issue with a copy code.

    on attached file, please run the module6 (sub Test).

    I don't understand why there's a debug error on

    Code
    1. Sheets("PORTO").Range(Cells(cel.Row, "A"), Cells(cel.Row, "C")).Copy Sheets("BATTAGLIA").Cells(lastrow + 1, 2)

    reference on sheets and cells seems OK.


    Thanks for any suggestion

    Files

    • Test1.xlsm

      (53.02 kB, downloaded 82 times, last: )
  • You need to qualify the Cells as well as the range, try

    Code
    1. With Sheets("PORTO")
    2. .Range(.Cells(cel.Row, "A"), .Cells(cel.Row, "C")).Copy Sheets("BATTAGLIA").Cells(Lastrow + 1, 2)
    3. End With