Hi guys,
I am trying to get VBA to enter a formula into my sheet. The VBA code is as follows:
However, when the macro is ran, the code that gets inserted is:
How do I get VBA to enter the code with the ' ' around A1 and D4, as with these symbols, the formula returns an error.
Many thanks for your help
I am trying to get VBA to enter a formula into my sheet. The VBA code is as follows:
Code:
Range("E4").Select
ActiveCell.FormulaR1C1 = _
"=INDEX((OFFSET(AvSort!A1,0,0,COUNT(AvSort!i:i),1)),D4,1)"
However, when the macro is ran, the code that gets inserted is:
Code:
=INDEX((OFFSET(AvSort!'A1',0,0,COUNT(AvSort!i:i),1)),'D4',1)
How do I get VBA to enter the code with the ' ' around A1 and D4, as with these symbols, the formula returns an error.
Many thanks for your help