I have code under which should give me Hlookup formula.
But something is wrong.
Can anyone help me to write Hlookup formula? (I need to write Hlookup formula in Cell D10, like D10=HLOOKUP(D10;F_pre_mj;10;False)
any suggestions?
Sub copy_prev_month()
Range("D10").FormulaR1C1 = "=HLOOKUP(R[-10]C1;F_pre_m;10;false)"
Range("D10:D20").Copy
Range("F10:F20").PasteSpecial Paste:=xlPasteFormulas
Range("H10:H20").PasteSpecial Paste:=xlPasteFormulas
End Sub
But something is wrong.
Can anyone help me to write Hlookup formula? (I need to write Hlookup formula in Cell D10, like D10=HLOOKUP(D10;F_pre_mj;10;False)
any suggestions?
Sub copy_prev_month()
Range("D10").FormulaR1C1 = "=HLOOKUP(R[-10]C1;F_pre_m;10;false)"
Range("D10:D20").Copy
Range("F10:F20").PasteSpecial Paste:=xlPasteFormulas
Range("H10:H20").PasteSpecial Paste:=xlPasteFormulas
End Sub