Hi trying to paste a formula using VBA
The first line is a dummy line to test and it works
but the second and 3rd which I want to use are giving my runtime error 1004
When pasting the formula directly in the worksheet it works
Reason I want to use through VBA is that I need to clear part of the worksheet before importing new data and that will give me a REF error in the formula in the worksheet
therefore want to add after import
The first line is a dummy line to test and it works
but the second and 3rd which I want to use are giving my runtime error 1004
When pasting the formula directly in the worksheet it works
Reason I want to use through VBA is that I need to clear part of the worksheet before importing new data and that will give me a REF error in the formula in the worksheet
therefore want to add after import
VBA Code:
WS.Range("D2").Formula = "=i2+j2"
WS.Range("F2:F100").Formula = "=IFNA(INDEX('Data Validation'!$O$3:$O$40,MATCH($D2,'Data Validation'!$N$3:$N$40,0)),"")"
WS.Range("G2:G100").Formula = "=IFNA(INDEX('Data Validation'!$P$3:$P$40,MATCH($D2,'Data Validation'!$N$3:$N$40,0)),"")"