//大家好,如果你这样做,我会约会。 我使用下面的宏来打开“J:J”列中的超链接。并添加了一个MsgBox来循环它。如果用户点击它,我将继续下一步。 我需要“是”& MsgBox上的“否”按钮。如果我点击是我应该继续,如果我点击否然后我想调用另一个模块,比如Sub refresh()。提前谢谢。
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
答案 0 :(得分:2)
喜欢这个吗?
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