excel目录如何批量给工作表做目录并实现超链接

2025-03-10 12:14:28
推荐回答(1个)
回答1:

可以用VBA完成
sub AddLinks()
dim sht as worksheet ,irow%: irow = 2
with worksheets(1)
for each sht in worksheets
.cells(irow,1).value = irow -1
.hyperlinks.add anchor:=.cells(irow,2),address:="",subaddress:=","& sht.name & ",!A1",texttodisplay:=sht.name
irow = irow +1
next
end sub