下面是用于 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
知道为什么需要很长时间才能完成..提前谢谢..