Copy data from one sheet to another
I'm having a problem in a macro, I'm trying to copy data from a sheet and paste in another, but this giving an error when inserting a new line (in yellow).
Code:
Sub copiarDadosEntrePlanilhas()
Application.ScreenUpdating = False
Worksheets(2).Rows("2:2").Insert
'copia de Formulario para Apontamento
Worksheets("Formulario").Range("B3").Copy Destination:=Worksheets("Apontados").Range("A2")
Worksheets("Formulario").Range("H3").Copy Destination:=Worksheets("Apontados").Range("B2")
Worksheets("Formulario").Range("B7").Copy Destination:=Worksheets("Apontados").Range("C2")
Worksheets("Formulario").Range("H7").Copy Destination:=Worksheets("Apontados").Range("D2")
Worksheets("Formulario").Range("N3").Copy Destination:=Worksheets("Apontados").Range("E2")
Worksheets("Formulario").Range("N7").Copy Destination:=Worksheets("Apontados").Range("F2")
Worksheets("Formulario").Range("N11").Copy Destination:=Worksheets("Apontados").Range("G2")
Worksheets("Formulario").Range("N14").Copy Destination:=Worksheets("Apontados").Range("H2")
Worksheets("Formulario").Range("B11").Copy Destination:=Worksheets("Apontados").Range("I2")
Worksheets("Formulario").Range("H11").Copy Destination:=Worksheets("Apontados").Range("J2")
Application.CutCopyMode = falso
'Mensagem de texto
MsgBox "Registro concluĂdo!", vbInformation, "ConcluĂdo"
Application.ScreenUpdating = True
End Sub
0
2 answers
Try changing the statement:
Application.CutCopyMode = Falso
By
Application.CutCopyMode = False
1
Author: Wilson Campos, 2018-04-23 18:12:06
For your code to run faster, instead of copy and paste, you could do:
Worksheets("Apontados").cells("A2").value = worksheets("Formulario").cells("B3").value
And repeat this syntax for the remaining lines of the code.
0
Author: Akk_Pain, 2018-04-27 13:52:11