# PC Gurus: Hyperlinks in Excel...?

**URL:** <https://boards.straightdope.com/t/pc-gurus-hyperlinks-in-excel/241206>\
**Category:** Factual Questions\
**Created:** [April 21, 2004, 12:38pm UTC](https://boards.straightdope.com/t/pc-gurus-hyperlinks-in-excel/241206 "2004-04-21T12:38:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jinx](https://avatars.discourse-cdn.com/v4/letter/j/c6cbf5/32.png) [@Jinx](https://boards.straightdope.com/u/Jinx)\
**Post date:** [April 21, 2004, 12:38pm UTC](https://boards.straightdope.com/t/pc-gurus-hyperlinks-in-excel/241206/1 "2004-04-21T12:38:17Z")

</div>

I have a CD loaded with files organized in folders and sub-folders. Since many people need to borrow this disk to access documents, I have created an index using an Excel spreadsheet.

The question arose: Since my index shows the file name, can I make it a hyperlink so one can just quick on the link to launch the document right there and then? Perhaps a macro would allow me to do this?

I thought if there were to enter the exact path of the file, perhaps using html code, it will recognize the filename as a url? …Otherwise, it is very awkward and clumsy. If it matters at all, my documents are Word and Adobe files. There may be an occasional tif or jpg file. But, all files are all self-contained on this CD along with the index file.

Any suggestions or alternative possibilities appreciated.

- Jinx

---

<div class="post-metadata">

**Author:** ![dylan\_73](https://avatars.discourse-cdn.com/v4/letter/d/ecccb3/32.png) [@dylan\_73](https://boards.straightdope.com/u/dylan_73)\
**Post date:** [April 21, 2004, 12:50pm UTC](https://boards.straightdope.com/t/pc-gurus-hyperlinks-in-excel/241206/2 "2004-04-21T12:50:13Z")

</div>

Select the cell and go to Insert…Link. If you record this as a macro you can probably work out how to automate it for large numbers of files.

---

<div class="post-metadata">

**Author:** ![Jinx](https://avatars.discourse-cdn.com/v4/letter/j/c6cbf5/32.png) [@Jinx](https://boards.straightdope.com/u/Jinx)\
**Post date:** [April 21, 2004, 1:11pm UTC](https://boards.straightdope.com/t/pc-gurus-hyperlinks-in-excel/241206/3 "2004-04-21T13:11:55Z")

</div>

Yup! That seems to do it! Excel has so many bells and whistles, the newer features tend to get lost in the mix…

Thanks,

- Jinx

---

<div class="post-metadata">

**Author:** ![larsenmtl](https://avatars.discourse-cdn.com/v4/letter/l/d78d45/32.png) [@larsenmtl](https://boards.straightdope.com/u/larsenmtl)\
**Post date:** [April 21, 2004, 3:27pm UTC](https://boards.straightdope.com/t/pc-gurus-hyperlinks-in-excel/241206/4 "2004-04-21T15:27:18Z")

</div>

> [@dylan\_73](#):
>
> Select the cell and go to Insert…Link. If you record this as a macro you can probably work out how to automate it for large numbers of files.

Oh, I like this idea so I wrote a little VBA Code. This assumes that all links are in the A Column and have the full path to the file name in the cell. You can easily modify the code depending on where your links are and how they are formatted.

```auto

Dim i As Integer
For i = 1 To 27 'For Cells A1 to A27, adjust for more or less

    Range("A" & i).Select
    ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:= _
        Range("A" & i).Text, TextToDisplay:=Range("A" & i).Text
        
Next

```
