Dear all,
I am new and need help. I have one central data file (call it boss.xls). Its name changes every quarter. Likewise I have two other files (call them bank1 and bank2). These names also change every quarter.
So I thought that I will store the new names of these files in say cells J4, in different sheets, sheet 1 & sheet 2 of a processing file (call it headache.xls)..this wont change every qtr, LOL.
Then I will move the current names of boss, bank1 and bank2 in variables say Vara1, vara2 and Vara3. This will allow me to later select cells of these files by using the variable names in macro.
I need to copy certain cells contained in vara1, vara2 and vara 3 at certain places (say cell D6 onwards of headache file, i.e the one which is the processing file.
So what would be the macrocode for such a process?
I used something like
DIm etc.....
Windows("headache.xlsm").Activate
vara1 = Range(" j3").value
vara2 = Worksheets("Sheet1").Range("j4").value
vara3 = Worksheets("Sheet2").Range("j4").value
Range("D6").Select
ActiveCell.FormulaR1C1 = _
"='[vara1.xls]BOSS output'!R15C14")
I am getting #REF error.
Plz help. Thanks.