PDA

View Full Version : Copy-paste data from source file to master workbook



Djani
04-14-2016, 07:10 AM
Dear all,

I am not great in writing VBA codes, so that's why I came here to ask for help. I would like to have a macro that automatically copy-pastes data from one file to another: Test QQ (=source file) and MOSYBASE (=master workbook).

The range B3:R1000 in sheet "Model Synthesis" from the source file "Test QQ" is what I would like to copy. This range will never change since the format/structure of the source file won't ever change. I want to paste this range in the sheet "Test" from the master workbook "MOSYBASE".

Can anyone help me out? I have the following:



Sub FillCENTERAB()
Dim ws As Worksheet
Set ws = ActiveWorkbook.Worksheets("Sheet1")
'Name of file and pathlink
Filename = "MOSYFILE QASHQAI.xlsx"
Workbooks.Open "I:\R&E Internal\01 Reporting & Tools\05 Pricing\01 Monthly Topics\01 VIVA\01 PC\03 FY16 ViVA\0. MOSY Automation\" & Filename

Dim destWS As Worksheet, LR As Long
Set destWS = ActiveSheet



Many thanks in advance!