以下は、vlookup と countif のコードです。
完了するまでに 5 分以上かかります。マクロを高速化するためのアイデアはありますか?
With Sheets("HW INVENT")
lRow = .Range("A200000").End(xlUp).Row
Application.screenupdating=false
Application.Calculation = xlCalculationManual
.Range("C2:C" & lRow).FormulaR1C1 = "=VLOOKUP(RC[-1],LAST_WEEK_KPI!C[-1]:C,2,0)"
.Range("D2:D" & lRow).FormulaR1C1 = "=COUNTIF(R2C2:R" & lRow & ",RC[-2])"
.Range("F2:F" & lRow).FormulaR1C1 = "=VLOOKUP(RC[-1],LAST_WEEK_KPI!C[-1]:C,2,0)"
.Range("G2:G" & lRow).FormulaR1C1 = "=COUNTIF(R2C5:R" & lRow & ",RC[-2])"
Application.Calculation = xlCalculationAutomatic
Application.screenupdating=true
End With
完了するのに時間がかかりすぎる理由..事前に感謝..