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


当前回答

对我来说,我只是复制了整个列,其中有文本格式的url到另一个应用程序(说Evernote),当他们粘贴在那里,他们成为链接,然后我只是复制回Excel。

这里唯一需要做的是确保复制回来的数据与其余列对齐。

其他回答

将url放入HTML表格,将HTML页面加载到浏览器中,复制该页面的内容,粘贴到Excel中。此时,url被保留为活动链接。

解决方案是由(Jim Gordon Mac MVP)在http://answers.microsoft.com/en-us/mac/forum/macoffice2008-macexcel/how-to-copy-and-paste-to-mac-excel-2008-a-list-of/c5fa2890-acf5-461d-adb5-32480855e11e上提出的[http://answers.microsoft.com/en-us/profile/75a2b744-a259-49bb-8eb1-7db61dae9e78]

我发现这很有效。

我有这些url:

https://twitter.com/keeseter/status/578350771235872768/photo/1 https://instagram.com/p/ys5ASPCDEV/ https://igcdn-photos-g-a.akamaihd.net/hphotos-ak-xfa1/t51.2885-15/10881854_329617847240910_1814142151_n.jpg https://twitter.com/ranadotson/status/539485028712189952/photo/1 https://instagram.com/p/0OgdvyxMhW/ https://instagram.com/p/1nynTiiLSb/

我把它们放入一个HTML文件(links.html),就像这样:

<table>
<tr><td><a href="https://twitter.com/keeseter/status/578350771235872768/photo/1">https://twitter.com/keeseter/status/578350771235872768/photo/1</a></td></tr>
<tr><td><a href="https://instagram.com/p/ys5ASPCDEV/">https://instagram.com/p/ys5ASPCDEV/</a></td></tr>
<tr><td><a href="https://igcdn-photos-g-a.akamaihd.net/hphotos-ak-xfa1/t51.2885-15/10881854_329617847240910_1814142151_n.jpg">https://igcdn-photos-g-a.akamaihd.net/hphotos-ak-xfa1/t51.2885-15/10881854_329617847240910_1814142151_n.jpg</a></td></tr>
<tr><td><a href="https://twitter.com/ranadotson/status/539485028712189952/photo/1">https://twitter.com/ranadotson/status/539485028712189952/photo/1</a></td></tr>
<tr><td><a href="https://instagram.com/p/0OgdvyxMhW/">https://instagram.com/p/0OgdvyxMhW/</a></td></tr>
</table>

然后我将links.html加载到浏览器中,复制粘贴到Excel中,链接就激活了。

我发现,如果超链接不包括http://,因为它们链接到本地位置,那么这里的方法都不起作用。

我还想让脚本万无一失,因为用户无法自己维护它,而我也无法使用。

它只会在选定范围内包含点且没有空格的单元格上运行。它最多只能运行1万个细胞。

Sub HyperAdd()
Dim CellsWithSpaces As String
    'Converts each text hyperlink selected into a working hyperlink
    Application.ScreenUpdating = False
    Dim NotPresent As Integer
    NotPresent = 0

    For Each xCell In Selection
        xCell.Formula = Trim(xCell.Formula)
        If xCell.Formula = "" Or InStr(xCell.Formula, ".") = NotPresent Then
        'Do nothing if the cell is blank or contains no dots
        Else
            If InStr(xCell.Formula, " ") <> 0 Then
                CellsWithSpaces = CellsWithSpaces & ", " & Replace(xCell.Address, "$", "")
                 GoTo Nextxcell
            End If

            If InStr(xCell.Formula, "http") <> 0 Then
                Hyperstring = Trim(xCell.Formula)
            Else
                Hyperstring = "http://" & Trim(xCell.Formula)
            End If

            ActiveSheet.Hyperlinks.Add Anchor:=xCell, Address:=Hyperstring

        End If
        i = i + 1
        If i = 10000 Then Exit Sub
Nextxcell:
      Next xCell
    If Not CellsWithSpaces = "" Then
        MsgBox ("Please remove spaces from the following cells:" & CellsWithSpaces)
    End If
Application.ScreenUpdating = True
End Sub

Excel 2010中最简单的方法: 选择带有URL文本的列,然后从“主页”选项卡选择“超链接样式”。 列中的所有url现在都是超链接。

同时双击URL文本末尾的每个单元格,并添加一个空白或直接输入也会产生一个超链接。类似于您必须在MS Outlook电子邮件中创建URL链接的方式。

好吧,这是一个做作的解决方案,但我只是不知道如何让Excel评估一列的url作为超链接批量。

创建公式="=hyperlink(""" & A1 & """)" 拖累 复制新公式列 仅在原始列上粘贴特殊值 突出显示列,单击Ctrl-H(以替换),查找并用=替换=(以某种方式强制重新计算单元格)。 单元格现在应该是可点击的超链接。如果你想要蓝色/下划线样式,然后只突出所有单元格,并选择超链接样式。

超链接样式本身不能转换为可点击的链接,“插入超链接”对话框似乎不能将文本作为一堆单元格的地址。除此之外,F2和Enter通过所有单元格就可以做到这一点,但这对很多单元格来说很乏味。

最简单的方法

突出显示整个列 单击“插入” 点击“超链接” 点击“放入此文档” 单击ok 这是所有