Excel提取超链接信息
打开Excel文档,按“Alt+F11”进入VBA环境。右击“Microsoft Excel 对象”,从其扩展菜单中选择“插入”-“模块”项。
接着在打开的“模块1”编辑界面中,输入如图所示的代码:
Function GetActAddress(HlinkCell)
Application.Volatile True
With HlinkCell.Hyperlinks(1)
GetActAddress = IIf(.Address = "", .SubAddress, .Address)
End With
End Function
返回Excel界面,在超链接右侧的单元格输入“=GetActAddress(A2)”即可看到自定义的函数
输入完整公司,并按回车键进行确认,即可看到超链接地址提取成功。
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!