Good afternoon, I want to copy certain columns from a file to another file in a particular order. I have created an array of all the column headings I'm looking for (in case my 'supplier' changes the order of my source data) & thought that a good way would be to use MATCH to find the relevant column number; however, I either can't get the syntax correct or it's not possible. This is a distilled version of that part of the code:-
This is what happens:-
Instead of what I was hoping for:-
I've tried various combinations of speech marks but it's not doing it? Any suggestions please?
Many thanks,
D€$
Code:
ha = "redflag_nps"
ActiveCell.FormulaR1C1 = "=MATCH(" & ha & ",UKC12400657_0.csv!R1,0)"
This is what happens:-
=MATCH(redflag_nps,UKC12400657_0.csv!$1:$1,0)
Result: #NAME?
Instead of what I was hoping for:-
=MATCH("redflag_nps",UKC12400657_0.csv!$1:$1,0)
Result: 223
I've tried various combinations of speech marks but it's not doing it? Any suggestions please?
Many thanks,
D€$