VBA - Paste Reports into a Determined Sheet

Asked

Viewed 107 times

0

I am mounting a macro that opens a specific report copy the data and paste into another spreadsheet in a given sheet. But I’m having a hard time at the part where I can stick it 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 the error message appears 424;

Now enters the problem. I can not paste this report in the spreadsheet (by the way this spreadsheet is where I am mounting the macro)

  • Try to do everything you want by saving a macro and then study the code. I think your question is very comprehensive...

1 answer

1

Natalia, Try to change that part:

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

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

For:

Range("A2:R16").Copy

Sheets("nome da sheet").Range("A5").Paste

Browser other questions tagged

You are not signed in. Login or sign up in order to post.