使用vba中列表中的链接

时间:2017-09-22 06:55:58

标签: vba excel-vba excel

我想从容器中使用链接:逐个。我不知道这样做的正确方法。我试图在下面尝试的方式有点奇怪,但它会让你知道我想要达到的目标。

Sub Iterating_links()
    Dim str As String, vault As String

    vault = "https://www.yify-torrent.org/search/1080p/, https://yts.ag/browse-movies"

    For Each str In vault
        MsgBox str
    Next str
End Sub

容器vault中有两个链接,我希望逐个在msgbox中看到结果。感谢。

1 个答案:

答案 0 :(得分:0)

假设您的链接已由,尝试

分开
Sub Iterating_links()
    Dim str As String, vault As String
    Dim arr() As String, items

    vault = "https://www.yify-torrent.org/search/1080p/, https://yts.ag/browse-movies"
    arr() = Split(vault, ",")

    For Each items In arr
        MsgBox items
    Next items
End Sub