待定犯傻的病人 发表于 2019-8-15 15:57:32

Excel批量打开URL


Excel批量打开URL
Sub GoInternet()
    Dim item As Range

    If TypeName(Selection) <> "Range" Then
      Exit Sub
    End If

    Dim Url As String
    For Each item In Selection

      If InStr(item.Text, "http") < 1 Then
            Url = "http://" & item.Text
      End If

      ActiveSheet.Hyperlinks.Add item, Url

      item.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
    Next item

End Sub
上面的代码很好理解。复制到Excel中,选中链接,运行即可。

sakiny 发表于 2019-9-11 11:46:41

原来如此,感谢分享!
页: [1]
查看完整版本: Excel批量打开URL