Mrrrr's Forum (VIEW ONLY)
Un forum care ofera solutii pentru unele probleme legate in general de PC. Pe langa solutii, aici puteti gasi si alte lucruri interesante // A forum that offers solutions to some PC related issues. Besides these, here you can find more interesting stuff.
Lista Forumurilor Pe Tematici
Mrrrr's Forum (VIEW ONLY) | Reguli | Inregistrare | Login

POZE MRRRR'S FORUM (VIEW ONLY)

Nu sunteti logat.
Nou pe simpatie:
Bianca777 pe Simpatie.ro
Femeie
19 ani
Brasov
cauta Barbat
19 - 61 ani
Mrrrr's Forum (VIEW ONLY) / Tutoriale si Ghiduri Utile // Tutorials and useful guides / [EXCEL] Hyperlink a Cell to Itself (VBA) Moderat de TRaP, TonyTzu
Autor
Mesaj Pagini: 1
TRaP
Moderator

Inregistrat: acum 6 ani
Postari: 739
The code below adds hyperlink to cells in selection to themselves.

I use this for using hyperlinks to external PDF files for going to a specific page in that PDF file.
See an example of what I mean here:


Sub HyLnk_cell_to_oneself()

For Each cell In Selection
    i = cell.Address
   
    If cell.Value <> "" Then
        ActiveSheet.Hyperlinks.Add Anchor:=cell, Address:="", SubAddress:=Chr(39) & ActiveSheet.Name & Chr(39) & "!" & i, TextToDisplay:=cell.Value
    End If
Next cell

End Sub


updated


pus acum 1 an
   
TRaP
Moderator

Inregistrat: acum 6 ani
Postari: 739
Added an IF clause since the original code errors if any cell in range is empty.

pus acum 1 an
   
Pagini: 1  

Mergi la