Excel数据输入/暂停宏 [英] Excel Data Entry/Pause Macro
本文介绍了Excel数据输入/暂停宏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要一个代码转到A1,允许我编辑或重新输入单元格然后在我按下回车后继续,不需要对话框但是没问题。
推荐答案
Option Explicit
Sub Main()
'Prepare
Range("A1").Select
'Wait
WaitUntilCellWasLeft
'Whatever
MsgBox "You left the cell"
End Sub
Sub WaitUntilCellWasLeft()
Dim Here As Range
'Get the active cell
Set Here = ActiveCell
Do
'Give time slices to the system
DoEvents
'Done if the cell changes
Loop Until ActiveCell.Address(External:=True) <> Here.Address(External:=True)
End Sub
这篇关于Excel数据输入/暂停宏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文