Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
374 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 Answer

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#

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...