如何在Excelmacros中获得两个条件的味精盒?

//你好,如果你为我做这个,你会做我的约会。 我正在使用下面的macros来打开“J:J”列中的超链接。 并添加一个MsgBox来循环它。 如果用户点击它,我将继续下一步。 我需要MsgBox上的“是”和“否”button。 如果我点击是的,我应该继续,如果我点击否,然后我想调用另一个模块,像子刷新()。 提前致谢。

Sub OpenLinks() Dim Cell As Range Set LinkRng = Range("J1").CurrentRegion.Columns(1) On Error Resume Next For Each Cell In LinkRng.Cells Cell.Hyperlinks(1).Follow Do If ie.readyState = 4 Then ie.Visible = False Exit Do Else DoEvents End If Loop MsgBox "OK" ie.Visible = True Next On Error GoTo 0 End Sub 

喜欢这个?

 Sub OpenLinks() Dim LinkRng As Range Set LinkRng = Range("J1").CurrentRegion.Columns(1) For Each cell In LinkRng.Cells If MsgBox("Continue?", vbYesNo) = vbYes Then Cell.Hyperlinks(1).Follow Else Refresh End If Do If ie.readyState = 4 Then ie.Visible = False Exit Do Else DoEvents End If Loop MsgBox "OK" ie.Visible = True Next On Error GoTo 0 End Sub