列如:
姓名 | 学号 | 博客地址 |
---|---|---|
1309032022 | 小张 | https://www.cnblogs.com/xiaozhangpython/ |
1413042001 | 小张学Python | https://www.cnblogs.com/xiaozhangpython/ |
1413042002 | 小张学Python | https://www.cnblogs.com/xiaozhangpython/ |
等等
Public Sub addURL()
Dim BLeft As String
Dim CRight As String
Dim Line As Integer
For Line = 2 To 58 ‘分别标示起始和结束行,实际使用时 调整参数 2和 58, 也可以作为函数参数
BLeft = "B" + CStr(Line)
CRight = "C" + CStr(Line)
Range(BLeft).Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:=Range(CRight).Value, TextToDisplay:=Range(BLeft).Value
Range(CRight).Clear ‘ 将C列清除
Next Line
End Sub
姓名 | 学号 | 博客地址 |
---|---|---|
1309032022 | 小张 | |
1413042001 | 小张学Python | |
1413042002 | 小张学Python |
原文:https://www.cnblogs.com/xiaozhangpython/p/12844339.html