C
Carrie_Loos via OfficeKB.com
Is there a way to write the vlookup formula in visual basic while using an
array to be relative as if you were copying the formula from cell to cell on
a worksheet?
Sub Fill_In_Data()
Dim TestArrayData As Range
Application.ScreenUpdating = False
Set TestArrayData = Range("E3:AU400")
Sheets("Dates").Select
MyFormula = "=IF(ISNA(VLOOKUP(RC[-4]&"" ""&R[-2]C,Classes!C[-4]:C[24],29,
FALSE)),0,(VLOOKUP(RC[-4]&"" ""&R[-2]C,Classes!C[-4]:C[24],29,FALSE)))"
TestArrayData.FormulaArray = MyFormula
Application.ScreenUpdating = True
End Sub
array to be relative as if you were copying the formula from cell to cell on
a worksheet?
Sub Fill_In_Data()
Dim TestArrayData As Range
Application.ScreenUpdating = False
Set TestArrayData = Range("E3:AU400")
Sheets("Dates").Select
MyFormula = "=IF(ISNA(VLOOKUP(RC[-4]&"" ""&R[-2]C,Classes!C[-4]:C[24],29,
FALSE)),0,(VLOOKUP(RC[-4]&"" ""&R[-2]C,Classes!C[-4]:C[24],29,FALSE)))"
TestArrayData.FormulaArray = MyFormula
Application.ScreenUpdating = True
End Sub