小编ame*_*ete的帖子

How to make VBA code run faster when looping through 10,000 cells?

Sub GMC()  
    strike = 100
    cap = 120
    part = 3.25
    KO = 60

    For i = 1 To 1000
        exp(i) = Worksheets("Speeder premium").Cells(i + 1, 32)
        If exp(i) >= cap Then
            cash = strike + (part * (cap - strike))
        ElseIf exp(i) >= strike And exp(i) < cap Then
            cash = strike + (part * (exp(i) - strike))
        ElseIf exp(i) < strike And exp(i) >= KO Then
            cash = strike
        ElseIf exp(i) < strike And exp(i) < KO Then …
Run Code Online (Sandbox Code Playgroud)

excel vba

1
推荐指数
1
解决办法
307
查看次数

标签 统计

excel ×1

vba ×1