如何过滤excel中的超链接?

时间:2013-10-27 20:28:03

标签: excel excel-formula

我有一些超链接的行,没有超链接 我想只过滤超链接数据。谢谢。

2 个答案:

答案 0 :(得分:2)

高亮(选择)要过滤的A列中的单元格(不包括标题行)并运行此小宏:

Sub HyperPicker()
    Dim r As Range
    For Each r In Selection
        If r.Hyperlinks.Count = 0 Then
            r.EntireRow.Hidden = True
        End If
    Next
End Sub

答案 1 :(得分:1)

如您在评论部分中所述,这会复制带有指向B列链接的超链接:

Sub Macro1()
    cnt = 1
    For Each cell In Range("A:A")
        If cell.Hyperlinks.Count > 0 Then
            Range("B" & cnt) = cell
            ActiveSheet.Hyperlinks.Add Range("B" & cnt), cell.Hyperlinks(1).Address
            cnt = cnt + 1
        End If
    Next
End Sub
相关问题