Saltar al contenido principal

¿Cómo copiar hipervínculo solo de una celda a otra en Excel?

Supongamos que tengo una lista de valores en la columna A y cada celda contiene un hipervínculo diferente, ahora, quiero copiar solo los hipervínculos sin texto a otra columna E como se muestra en la siguiente captura de pantalla. Puede que no haya una forma directa de resolver este trabajo en Excel, pero aquí puedo presentar un código VBA para solucionarlo.

doc copiar hipervínculo a otra celda 1

Copie el hipervínculo de una celda a otra con código VBA


flecha azul burbuja derecha Copie el hipervínculo de una celda a otra con código VBA

Para copiar solo las direcciones de hipervínculo sin el texto a otras celdas, el siguiente código puede hacerle un favor, por favor, haga lo siguiente:

1. Mantenga pulsado el ALT + F11 teclas para abrir el Microsoft Visual Basic para aplicaciones ventana.

2. Hacer clic recuadro > Móduloy pegue el siguiente código en el Módulo Ventana.

Código de VBA: copie el hipervínculo solo de una celda a otra:

Sub CopyHyperlinks()
'Uodateby Extendoffice
    Dim xSRg As Range
    Dim xDRg As Range
    Dim I As Integer
    Dim xAddress As String
    On Error Resume Next
    xAddress = ActiveWindow.RangeSelection.Address
    Set xSRg = Application.InputBox("Please select the original range you want to copy hyperlinks:", "KuTools For Excel", xAddress, , , , , 8)
    If xSRg Is Nothing Then Exit Sub
    Set xDRg = Application.InputBox("Please select the new range you want to paste the hyperlinks only", "KuTools For Excel", , , , , , 8)
    If xDRg Is Nothing Then Exit Sub
    Set xDRg = xDRg(1)
    For I = 1 To xSRg.Count
        If xSRg(I) <> "" And xDRg.Offset(I - 1) <> "" Then
            If xSRg(I).Hyperlinks.Count = 1 Then
                xDRg(I).Hyperlinks.Add xDRg(I), xSRg(I).Hyperlinks(1).Address
            End If
        End If
    Next
End Sub

3. Y luego presione F5 para ejecutar este código, aparecerá un cuadro de diálogo para recordarle que seleccione las celdas en las que desea copiar solo los hipervínculos, vea la captura de pantalla:

doc copiar hipervínculo a otra celda 02

4. Y luego haz clic OK, luego seleccione las celdas en las que desea pegar los hiperlines solo en otro cuadro de diálogo, vea la captura de pantalla:

doc copiar hipervínculo a otra celda 03

5. Y las direcciones de hipervínculo se han copiado de las celdas originales a las celdas especificadas según lo necesite, vea la captura de pantalla:

doc copiar hipervínculo a otra celda 04

Note: Este código también puede ayudarlo a copiar los hipervínculos de una hoja a otra hoja como desee.

Las mejores herramientas de productividad de oficina

🤖 Asistente de IA de Kutools: Revolucionar el análisis de datos basado en: Ejecución inteligente   |  Generar codigo  |  Crear fórmulas personalizadas  |  Analizar datos y generar gráficos  |  Invocar funciones de Kutools...
Características populares: Buscar, resaltar o identificar duplicados   |  Eliminar filas en blanco   |  Combine columnas o celdas sin perder datos   |   Ronda sin fórmula ...
Super búsqueda: Búsqueda virtual de criterios múltiples    Búsqueda V de valores múltiples  |   VLookup en varias hojas   |   Búsqueda difusa ....
Lista desplegable avanzada: Crear rápidamente una lista desplegable   |  Lista desplegable dependiente   |  Lista desplegable de selección múltiple ....
Administrador de columnas: Agregar un número específico de columnas  |  Mover columnas  |  Toggle Estado de visibilidad de columnas ocultas  |  Comparar rangos y columnas ...
Características destacadas: Enfoque de cuadrícula   |  Vista de diseño   |   Gran barra de fórmulas    Administrador de hojas y libros de trabajo   |  Biblioteca de Recursos (Texto automático)   |  Selector de fechas   |  Combinar hojas de trabajo   |  Cifrar/descifrar celdas    Enviar correos electrónicos por lista   |  Súper filtro   |   Filtro especial (filtro negrita/cursiva/tachado...) ...
Los 15 mejores conjuntos de herramientas12 Texto Herramientas (Añadir texto, Quitar caracteres, ...)   |   50+ Tabla Tipos (Diagrama de Gantt, ...)   |   40+ Práctico Fórmulas (Calcular la edad según el cumpleaños, ...)   |   19 Inserción Herramientas (Insertar código QR, Insertar imagen desde la ruta, ...)   |   12 Conversión Herramientas (Números a palabras, Conversión de Moneda, ...)   |   7 Fusionar y dividir Herramientas (Filas combinadas avanzadas, Células partidas, ...)   |   ... y más

Mejore sus habilidades de Excel con Kutools for Excel y experimente la eficiencia como nunca antes. Kutools for Excel ofrece más de 300 funciones avanzadas para aumentar la productividad y ahorrar tiempo.  Haga clic aquí para obtener la función que más necesita...

Descripción


Office Tab lleva la interfaz con pestañas a Office y hace que su trabajo sea mucho más fácil

  • Habilite la edición y lectura con pestañas en Word, Excel, PowerPoint, Publisher, Access, Visio y Project.
  • Abra y cree varios documentos en nuevas pestañas de la misma ventana, en lugar de en nuevas ventanas.
  • ¡Aumenta su productividad en un 50% y reduce cientos de clics del mouse todos los días!

 

Comments (13)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
I made the following edits to work for my use case:
Sub CopyHyperlinks()
'Uodateby Extendoffice
Dim xSRg As Range
Dim xDRg As Range
Dim I As Integer
Dim xAddress As String
On Error Resume Next
xAddress = ActiveWindow.RangeSelection.Address
Set xSRg = Application.InputBox("Please select the original range you want to copy hyperlinks:", "KuTools For Excel", xAddress, , , , , 8)
If xSRg Is Nothing Then Exit Sub
Set xDRg = Application.InputBox("Please select the new range you want to paste the hyperlinks only", "KuTools For Excel", , , , , , 8)
If xDRg Is Nothing Then Exit Sub
Set xDRg = xDRg(1)
For I = 1 To xSRg.Count
If xSRg(I).Hyperlinks(1).Address <> "" Or xSRg(I).Hyperlinks(1).SubAddress <> "" Then
If xSRg(I).Hyperlinks.Count = 1 Then
xDRg(I).Hyperlinks.Add Anchor:=xDRg(I), _
Address:=xSRg(I).Hyperlinks(1).Address, _
SubAddress:=xSRg(I).Hyperlinks(1).SubAddress
'ScreenTip:=xSRg(I).Hyperlinks(1).ScreenTip, _
'TextToDisplay:=xSRg(I).Hyperlinks(1).TextToDisplay
End If
End If
Next
End Sub
This comment was minimized by the moderator on the site
OK, so you won't publish my comment - which is fair. But if you want me to register and log in, then you need to show me solutions that work, because (on the basis of one non-working instance) I've seen nothing to persuade me that there's any value in registering.
This comment was minimized by the moderator on the site
Doesn't work for me; does the fact that I'm still using Excel 2007 matter?
This comment was minimized by the moderator on the site
This is awesome and it works. I love copy&pasting other people's code :D
This comment was minimized by the moderator on the site
This didn't work for me either.
This comment was minimized by the moderator on the site
Lets say in your cell A1 is hyperlink, so to get the path of the hyperlink just create formula like below:
>> (MID((FORMULATEXT(A1));(FIND("(";(FORMULATEXT(A1)))+2);(FIND(";";(FORMULATEXT(A1)))-1)-(FIND("(";(FORMULATEXT(A1)))+2))) <<
This comment was minimized by the moderator on the site
Doesn't work.
This comment was minimized by the moderator on the site
Love it. Thank you so muchoooo.
Love From Dominican Republic :)
This comment was minimized by the moderator on the site
Doesn't work.
This comment was minimized by the moderator on the site
hello.. what if i want to copy the hyperlink through vlookup? i already have the formula but when i click the the hyperlink it "cannot open specied file" will appear.

Please help me
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations