美文网首页
excel 超链接 批量校验是否可用

excel 超链接 批量校验是否可用

作者: 朱俊华_8803 | 来源:发表于2019-10-10 17:52 被阅读0次

// 校验超链接对应文件地址 是否存在
Public Function FileFolderExists(strFullPath As String) As Boolean

    On Error GoTo EarlyExit

    If Not Dir(strFullPath, vbDirectory) = vbNullString Then FileFolderExists = True

EarlyExit:

    On Error GoTo 0

End Function


Sub check()

Dim url1 As String, chk As Boolean

For i = 6 To 158

    If Cells(i, "e").Value <> "" Then

    url1 = "Z:\CMMI修改后\" & Cells(i, "e").Value

    chk = FileFolderExists(url1)

    Cells(i, "q").Value = IIf(chk, "有效", "无效")

    End If

Next

End Sub

相关文章

网友评论

      本文标题:excel 超链接 批量校验是否可用

      本文链接:https://www.haomeiwen.com/subject/cuhubxtx.html