I want to apply a formula that is automatically calculated by a column input from an Excel table to a specific column. At this time, since the column to which the formula is applied should appear at the same interval, the following code value is used and an error occurs. What am I doing wrong?
1004 runtime error
For b = 68 To 299 Step 21
Cells(2, b).Select
ActiveCell.Formula = "=IFERROR" & "([@[" & Cells(1, b - 2).Value & "]] " & "*" & "([@[" & Cells(1, b - 1).Value & "]]" & "/" & "1000000" & ")," & Chr(34) & Chr(34) & ")"
Cells(2, b).Select
Selection.AutoFill Destination:=Range("table1" & "[" & Cells(1, b) & "]")
Next b
cells(1,b) => table Header