vba,excel,网址提取名字与链接url

 
 
'宏操作

Sub 复制超级链接()

For a = 1 To 100 '这里控制读取A列的第1到10行,你根据自已的要求修改一下起始和结束行数
    If Cells(a, 1).Hyperlinks.Count > 0 Then Cells(a, 2).Value = Cells(a, 1).Hyperlinks.Item(1).Name

    If Cells(a, 1).Hyperlinks.Count > 0 Then Cells(a, 3).Value = Cells(a, 1).Hyperlinks.Item(1).Address
    
Next

End Sub
'自定义公式法
Function geturl(c As Range) As String
    geturl = c.Hyperlinks(1).Address
End Function

Function getname(c As Range) As String
getname = c.Hyperlinks(1).Name
End Function

猜你喜欢

转载自www.cnblogs.com/--3q/p/9122289.html