vba 指定单元格链接到其他excel

2024-11-27 12:17:26
推荐回答(2个)
回答1:

For j = 0 To 1
Dim myRange As Range
Dim myHyps As Hyperlinks
src = j & ".xls" ‘此处加号改为&
Set myRange = Sheets("Sheet1").Range("H" & j + 5)
Set myHyps = myRange.Hyperlinks
With myHyps
.Delete
.Add Anchor:=myRange, Address:=src, ScreenTip:=src, TextToDisplay:=src'此处selection改为myrange
End With
Set myHyps = Nothing
Set myRange = Nothing
Next j

回答2:

你可以自己试着录制宏,看看编码是怎么做的,有时比在上网找答案要快哦