Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
625 views
in Technique[技术] by (71.8m points)

excel - 如何暂停特定的时间? (Excel / VBA)(How to pause for specific amount of time? (Excel/VBA))

I have an Excel worksheet that has the following macro.

(我有一个包含以下宏的Excel工作表。)

I'd like to loop it every second but danged if I can find the function to do that.

(我想每秒钟循环一次,但如果我能找到执行此操作的功能,就会感到惊讶。)

Isn't it possible?

(有可能吗)

Sub Macro1()
'
' Macro1 Macro
'
Do
    Calculate
    'Here I want to wait for one second

Loop
End Sub
  ask by Keng translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Use the Wait method :

(使用Wait方法 :)

Application.Wait Now + #0:00:01#

or (for Excel 2010 and later):

(或(对于Excel 2010及更高版本):)

Application.Wait Now + #12:00:01 AM#

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...