VBA - Paste Reports on the determined Sheet

0

I am assembling a macro that opens a specific report that copies the data, and then pastes it into another worksheet on a particular sheet . But I'm having a hard time sticking to the other spreadsheet.

So far we have:

Dim as Integer
Data= Sheets("nome da sheet").Range("A1")
Range("A1").Value = Data

Workbooks.Open Filename: =
"Caminho do relatório\nome do relatório" & Data & ".xlsm"

Range("A2","R16").Copy

Active.Sheet("nome da sheet")

Range(A5,R65).pastespecial

And you get the error message 424 ;

Now comes the problem. I can not paste this report into the worksheet (by the way this worksheet is where I'm mounting the macro)

    
asked by anonymous 21.06.2017 / 16:54

1 answer

1

Natalia, Try changing this part:

Range("A2","R16").Copy

Active.Sheet("nome da sheet") Range(A5,R65).pastespecial

By:

Range("A2:R16").Copy

Sheets("nome da sheet").Range("A5").Paste
    
21.06.2017 / 21:20