Good day folks,
I have this code:
termmon = Month(Sheets("Main").Cells(9, 3)) + 1
Range("J30").Select
ActiveCell.FormulaR1C1 = "=HLOOKUP(""5 Days"",R[0]C[-8]:R[18]C[-2],
termmon, FALSE)"
When I try to use the variable "termmon" in the hlookup formula, I get
the #Name? in the active cell. I tried to copy and pastevalues in the
active cell but still the same thing happen. Do anyone know if there
is a way to get this to work?
Thank you
Chris

Signature
TheLeafs
Chip Pearson - 28 Feb 2006 14:26 GMT
Try
ActiveCell.FormulaR1C1 = "=HLOOKUP(""5
Days"",R[0]C[-8]:R[18]C[-2]," & _
termmon & ", FALSE)"

Signature
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
"TheLeafs"
>
> Good day folks,
[quoted text clipped - 18 lines]
>
> Chris
TheLeafs - 28 Feb 2006 14:47 GMT