本文介绍了超链接文件路径和Application.Selection的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我无法理解如何执行超链接(s)文件路径+如何获得要执行的单元格范围。



问题是当超链接名称(标题/主题)不是文件路径然后返回错误。要获得这个工作超链接必须是每个
c:\ folder \ filename.pdf细胞。




Application.Selection - 选定的单元格区域返回错误,例如A1:A5。我想使用范围而不是使用CTRL选择
每个单元格,因为将来它可能会强制我选择数百个。






将来我想将上传文件用于所选目录,并在所选单元格中插入超链接(如果有意义的话)

请建议。



Hi,

I cannot get my head around how to execute hyperlink(s) file path + how to get range of cells to execute.

The problem is when hyperlink name (title/subject) is not a file path then returns error. To get this working hyperlink must be c:\folder\filename.pdf for each cell.

Application.Selection - selected range of cells returns error for example A1:A5. I would like to use range rather than picking up each cells with CTRL as in future it might force me picking hundreds of them.


In future I would like to use upload files into selected directory and insert hyperlink in selected cell ( if that make any sense)
Please advice.


代码:

推荐答案

你有什么问题?在工作表中选择范围后,  ; Application.Selection将返回选定的Range。

What is your issue with this? After you select the Range in worksheet, Application.Selection will return the selected Range.

这是一个输出Selection的简单代码。

Here is a simple code to output the Selection.

Sub test()
Set WorkRng = Application.Selection
For Each cel In WorkRng
   If cel Is Nothing Then
   Else
    Debug.Print cel.Value
   End If
Next cel
End Sub


这篇关于超链接文件路径和Application.Selection的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-31 08:50