I have record macro and rewrite them as following with loop:
DailyUsage:
Dim i As Integer, j As Integer
Range("J15").Select
For i = 4 To 34
ActiveCell.FormulaR1C1 = _
"=IF(ISERROR(MATCH(RC,Drug!C1,0)),"""",INDEX(Drug!C2,MATCH(RC,Drug!C1,0)))"
Cells(15, 7 + i).Select
Next i
But the message remind me error '1004' object define error ....(My operation system is Chinese traditional text, don't know exact English notice.)
How can I set the range with integer or other variables well in this case?
Thanks.
DailyUsage:
Dim i As Integer, j As Integer
Range("J15").Select
For i = 4 To 34
ActiveCell.FormulaR1C1 = _
"=IF(ISERROR(MATCH(RC,Drug!C1,0)),"""",INDEX(Drug!C2,MATCH(RC,Drug!C1,0)))"
Cells(15, 7 + i).Select
Next i
But the message remind me error '1004' object define error ....(My operation system is Chinese traditional text, don't know exact English notice.)
How can I set the range with integer or other variables well in this case?
Thanks.