vba 修改Excel中网址为可点击

2020-03-13  本文已影响0人  HanssonLiu
Sub editUrl()

    For Each cell In Range("A2:A" & Cells(Rows.Count, 1).End(xlUp).Row)

        If Left(cell, 8) = "https://" Then

            ActiveSheet.Hyperlinks.Add cell, cell.Value

        End If

    Next

    For Each cell In Range("J2:J" & Cells(Rows.Count, 1).End(xlUp).Row)

        If Left(cell, 8) = "https://" Then

            ActiveSheet.Hyperlinks.Add cell, cell.Value

        End If

    Next

    For Each cell In Range("K2:K" & Cells(Rows.Count, 1).End(xlUp).Row)

        If Left(cell, 8) = "https://" Then

            ActiveSheet.Hyperlinks.Add cell, cell.Value

        End If

    Next

End Sub
上一篇 下一篇

猜你喜欢

热点阅读