I am at a loss right now. I made a macro to format some tables to insert into our ERP system. It copies formulas in quite a few places and all works fine, except this one.

I get a bug whereas my stops completely after this line:

Sheets("Transfert vers Epicor").Select

ActiveSheet.Range("I8").Select

Range("I8").Select

Range("I8").Select

Selection.AutoFill Destination:=Range("I8:I" & Cells(Rows.Count, "B").End(xlUp).Row)

I cannot seem to understand why, it copies formulas fine with that same structure up until it gets to this point.

Am I missing something?

I get a bug whereas my stops completely after this line:

Sheets("Transfert vers Epicor").Select

ActiveSheet.Range("I8").Select

Range("I8").Select

**ActiveCell.FormulaR1C1 = _**

"=IF(ISNUMBER(SEARCH(""pliage"",RC[-5],9)),VLOOKUP(RC[-4],Fournisseurs!R1C[-8]:R10C[-5],3,FALSE),IF(ISNUMBER(SEARCH(""Decoupe*"",RC[-5])),VLOOKUP(RC[-4],Fournisseurs!R1C[-8]:R10C[-5],2,FALSE),IF(ISNUMBER(SEARCH(""Coupe"",RC[-5])),VLOOKUP(RC[-4],Fournisseurs!R1C[-8]:R10C[-5],2,FALSE),IF(ISNUMBER(SEARCH(""Usinage"",RC[-5])),VLOOKUP(RC[-4],Fournisseurs!R1C[-8]:R10C[-5]," & _

",""""))))""=IF(ISNUMBER(SEARCH(""pliage"",RC[-5],9)),VLOOKUP(RC[-4],Fournisseurs!R1C[-8]:R10C[-5],3,FALSE),IF(ISNUMBER(SEARCH(""Decoupe*"",RC[-5])),VLOOKUP(RC[-4],Fournisseurs!R1C[-8]:R10C[-5],2,FALSE),IF(ISNUMBER(SEARCH(""Coupe"",RC[-5])),VLOOKUP(RC[-4],Fournisseurs!R1C[-8]:R10C[-5],2,FALSE),IF(ISNUMBER(SEARCH(""Usinage"",RC[-5])),VLOOKUP(RC[-4],Fournisseurs!R1C[-8]:R10C[-5]," & _

",""""))))"

Range("I8").Select

Selection.AutoFill Destination:=Range("I8:I" & Cells(Rows.Count, "B").End(xlUp).Row)

I cannot seem to understand why, it copies formulas fine with that same structure up until it gets to this point.

Am I missing something?

Last edited: