excel下的简单vba--自动生成并生成链接

Sub test1()
Dim x As Long
Set xlSheet = Sheets(1)
For x = 1 To 65530
    xlSheet.Cells(x, 1).Value = "test" & x
    xlSheet.Hyperlinks.Add Anchor:=Cells(x, 1), Address:="", SubAddress:="Sheet2" & "!A" & x
Next x
End Sub

Excel的最大链接数是65530,大于这个数无法继续添加链接

你可能感兴趣的:(excel下的简单vba--自动生成并生成链接)