我在excel中有一个列,其中我有所有的网站url值。我的问题是我想把url值转换为活动链接。该列中大约有200个条目,所有单元格中都有不同的url。是否有一种方法可以在不编写宏的情况下创建到所有单元格的活动超链接。


当前回答

对于使用Excel 2016登陆这里的任何人,您可以简单地突出显示该列,然后单击样式框中Home ribbon上的超链接选项卡。

编辑:不幸的是,这只更新单元格样式,而不是函数。

其他回答

如果不允许添加带有超链接的额外列, 另一种方法是使用外部编辑器将您的超链接包含到=hyperlink(" and "),以获得=hyperlink("originalCellContent")

如果你有notepad++,这是一个你可以用来半自动执行这个操作的配方:

Copy the column of addresses to Notepad++ Keeping ALT-SHIFT pressed, extended your cursor from the top left corner to the bottom left corner, and type =hyperlink(". This adds =hyperlink(" at the beginning of each entry. Open "Replace" menu (Ctrl-H), activate regular expressions (ALT-G), and replace $ (end of line) with "\). This adds a closed quote and a closed parenthesis (which needs to be escaped with \ when regular expressions are activated) at the end of each line. Paste back the data in Excel. In practice, just copy the data and select the first cell of the column where you want the data to end up.

如果你复制文本内容到一个新的列,并使用:

=HYPERLINK("http://"&B10,B10) 

在你原来的专栏上。然后使用$的列,使它看起来像这样:

=HYPERLINK("http://"&$B10,$B10)

这是我在Windows 7上使用Excel 2010的唯一方法。你可以把这个公式抄下来。

我很惊讶Excel没有自动做这个,所以这是我的解决方案,我希望对其他人有用,

将整个列复制到剪贴板 在Chrome或Firefox上打开这个

data:text/html,<button onclick=“document.write(document.body.querySelector('textarea').value.split('\n').map(x => '<a href=</a>\'' + x + '\'>' + x + '').join(''))<br>”>Linkify</button><br><textarea></textarea>

将该栏粘贴到刚刚在浏览器上打开的页面上,然后按“链接”键 将结果从选项卡复制到Excel的列中

代替第二步,您可以使用下面的页面,首先,单击“运行代码片段”,然后将列粘贴在上面 <按钮onclick = " document . write (document.body.querySelector(文本区域).value.split(“\ n”)。地图(x = > < a href = \”+ x + '\'>' + x + < / >) . join(“< br >”))按钮“>其内< / > < br > < textarea > < / >文本区域

使用Windows上的Excel 2007,我发现这些步骤最简单;

选择具有非活动url的单元格 复制 粘贴为超链接

我有一个数字列表,馈送到url的我想热链接。 例如,我有一个列A的问题编号(即,2595692,135171),我想把这些问题编号转换为热链接,并只显示问题编号。

因此,我建立了一个指向列a的纯文本超链接,并将其复制下来用于我所有的问题编号:

=“=超链接(”&“”“http”&“”&“”/stackoverflow.com/questions/“&”&“”&A1&“)”

然后我复制粘贴值这一列的文本超链接到另一列。

你最终会得到如下所示的一列文本:

=超链接(“http”&“:”&“//stackoverflow.com/questions/2595692”,2595692)

然后我选择这些粘贴的项目,并运行F2Entry宏如下:

Sub F2Enter()
Dim cell As Range
Application.Calculation = xlCalculationManual
For Each cell In Selection
    cell.Activate
    cell = Trim(cell)
Next cell
Application.Calculation = xlCalculationAutomatic
EndSub

然后我删除了文本输入列和列A。

我最终得到了一列热链接的问题数字:

2595692

135171

etc.

干杯