分享一个excel根据文件超链接获取链接文档的最后更新时间

#获取制定单元格内超链接对应的链接地址
Sub geturi() For Each cell In Range(
"E3:E43") If cell.Hyperlinks.Count <> 0 Then cell.Offset(0, 7) = cell.Hyperlinks(1).Address End If Next End Sub
#获取这些路径对应文档的最后修改时间, Sub get_filetime() Dim myFile As String Dim x As Date Dim Path As String Dim cel1 As String Dim lo1 As Integer lo1
= 43 Path = ThisWorkbook.Path For i = 3 To lo1 Step 1 Dim col As String Dim rowid As String col = "L" & CStr(i) rowid = "H" & CStr(i) cel1 = Worksheets("运维手册列表").Range(col).Value If cel1 <> "" Then myFile = Path & "" & cel1 x = FileDateTime(myFile) Worksheets("运维手册列表").Range(rowid).Value = x End If Next End Sub


#使用方法:在你需要操作的表格内alt+f11 打开vbs编辑框,粘贴进入即可,需要什么操作在右上角选择函数,f5执行函数即可。
#文档需要另存为xlsm后缀名,另外需要打开宏支持,运行宏运行,具体自行百度。
原文地址:https://www.cnblogs.com/netsa/p/7699910.html