宏将多个URL更改为Excel中显示的名称 [英] Macro to change multiple URL's to a displayed name in Excel

查看:132
本文介绍了宏将多个URL更改为Excel中显示的名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在创建一个简单的宏来转换许多宏时出现问题从显示URL到显示名称税务记录的同一列中的URL,并且有两个单词是
链接。我可以通过选择每个URL,编辑URL并将显示的名称更改为Tax Record来手动执行此操作。任何有关如何解决此问题的帮助将不胜感激。


提前感谢您的帮助!



 


解决方案

假设您的网址位于A栏(单元格A1:A30) - 您可以使用以下代码。


(您需要修改范围以反映您的实际URL列表...)


 


 
Dim cL As 范围
Dim nM 作为 String

对于 每个 cL 范围内(" A1 :A30"
cL。选择
nM = cL.Value
cL.Hyperlinks.Add Anchor:= Selection,Address:= nM,TextToDisplay:= "税务记录"
下一步


I am having a problem creating a simple macros to convert many URLs that are in the same column from displaying the URL to displaying the name Tax Record and having two word be the link. I can do this manually by selecting each URL, editing the URL and changing the displayed name to Tax Record. Any help on how to solve this would be greatly appreciated.

Thanks in advance for your help!

 

解决方案

Assuming your URL's are in column A (cells A1:A30) - you can use the following code.

(You will need to modify the range to reflect your actual list of URL's...)

 

Dim cL As Range
Dim nM As String

For Each cL In Range("A1:A30")
cL.Select
nM = cL.Value
cL.Hyperlinks.Add Anchor:=Selection, Address:=nM, TextToDisplay:="Tax Record"
Next


这篇关于宏将多个URL更改为Excel中显示的名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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