I am using a range in a vlookup formula. The problem is that when excel interprets the formula, the range name acts as if it's a string. Here's the code:
Dim pdq As Range
Set pdq = ActiveWorkbook.Sheets("Parameters").Range("$A:$P")
Cells(2, FinalCol).FormulaR1C1 = "=vlookup(RC1,pdq,16,false)"
The problem is that the formula doesn't convert RC1 to the right cell reference, nor does Excel convert "pdq" to the range. If I look at the cell formula, it looks exactly as what is between the quotes, but result is "#NAME?".
Any clue as to what is happening? Did I inadvertently trigger a setting? I'm using Excel 2007 with Windows 7.
Dim pdq As Range
Set pdq = ActiveWorkbook.Sheets("Parameters").Range("$A:$P")
Cells(2, FinalCol).FormulaR1C1 = "=vlookup(RC1,pdq,16,false)"
The problem is that the formula doesn't convert RC1 to the right cell reference, nor does Excel convert "pdq" to the range. If I look at the cell formula, it looks exactly as what is between the quotes, but result is "#NAME?".
Any clue as to what is happening? Did I inadvertently trigger a setting? I'm using Excel 2007 with Windows 7.