如何在 vba 中每秒多次 运行 一个宏?

How can I run a macro multiple times per second in vba?

我目前正在尝试使用 Application.OnTime 以每秒约五次的速度 运行 宏,但它不适用于少于一秒的时间。我知道 excel 可以多次处理我的宏,因为我已将它分配给一个键并按住它。那么有没有其他方法可以让我的宏每秒 运行 多次?

非常感谢。

Interval = 0.2
CurrentTime = Timer

Do While True
    If Timer > CurrentTime + Interval Then

        'Write your code here.
        
        Current = Timer
    End If
    DoEvents
Loop