当链接从地址中断时,excel中的超链接 [英] hyperlinks in excel when the link is broken from the address

查看:69
本文介绍了当链接从地址中断时,excel中的超链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当链接从地址断开时,excel中的超链接,我怎么能写一个vb代码,所以当我打开工作表时,它会自动搜索所有链接,并且如果地址已经改变,就能更新地址。例如:y:abc\sublet\sub
comp rev17 9 01-16.xlx更改为y:abc\sublet\sub comp rev18 10-01-16.xlx

解决方案

Sheet对象的超链接集合可以循环使用。如果要更改所有工作表,则为工作表创建另一个循环。


对于工作表中的每个sh


对于sh.Hyperlinks中的每个hyp


sh.Address =" New Address"


next hyp


next sh


但新地址与旧地址的关系如何?如果不相关则需要获取旧地址,在表中找到它,获取新地址,更改地址(如VLOOKUP)


如果可以,我们可以提供代码详细说明上述内容。


hyperlinks in excel when the link is broken from the address , how could I write a vb code so when I open the worksheet it will automatically search all the links and to be able to update the address if the address has changed. for example : y:abc\sublet\sub comp rev17 9 01-16.xlx changes to y:abc\sublet\sub comp rev18 10-01-16.xlx

解决方案

The hyperlinks collection of Sheet object can be looped for the same. If you want to change for all sheet then create another loop for sheet.

For Each sh in Worksheets

for Each hyp in sh.Hyperlinks

sh.Address="New Address"

next hyp

next sh

But how the new address is related with old adress ? If not related then you need to get old address, find it in a table, get the new address for that,change the address (Like VLOOKUP)

We can give a code if you could give detail for above.


这篇关于当链接从地址中断时,excel中的超链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆