I want to copy the contents of two excel in one, and all goes well until I copy the contents of my second excel, because this overwrites what the first copy excel, done that :
These are my statements:
Dim wbOrigen1 As Workbook, _
wbOrigen2 As Workbook, _
wsDestino As Excel.Worksheet, _
wsOrigen1 As Excel.Worksheet, _
wsOrigen2 As Excel.Worksheet, _
rngOrigen1 As Excel.Range, _
rngDestino As Excel.Range, _
rngDestino2 As Excel.Range, _
rngOrigen2 As Excel.Range
Here is the problem
ThisWorkbook.Activate
Set rngDestino2 = wsDestino.Range(celdaDestino,Range(celdaDestino).End(xlDown).Offset(1, 0))
Range(celdaDestino).End(xlDown).Offset(1, 0).Select
wsOrigen2.Activate
rngOrigen2.Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
ThisWorkbook.Activate
rngDestino2.PasteSpecial xlPasteValues
Application.CutCopyMode = False
But this does not work the same way. The problem seems to be with rngDestino2
?rngDestino2
Type Mismatch
?err.Description
Type Mismatch
How I can fix it?