Sub MakeHyperlinks()
'David McRitchie
Dim cell As Range
For Each cell In Intersect(Selection, _
Selection.SpecialCells(xlConstants, xlTextValues))
With Worksheets(1)
.Hyperlinks.Add anchor:=cell, _
Address:=cell.Value, _
ScreenTip:=cell.Value, _
TextToDisplay:=cell.Value
End With
Next cell
End Sub
Gord Dibben MS Excel MVP
On 21 Mar 2007 08:42:03 -0700, "infiniteMPG" <(E-Mail Removed)> wrote:
>We have an Excel spreadsheet that contains information to scanned
>images being populated into our engineering database. In the
>spreadsheet there is information as to the creation time and date,
>size, title and other related information. One of the columns is the
>name and location of the actual TIFF image file. This field is just
>text. What we would like to do is convert the cell from just text
>stating the location and filename to a hyperlink pointing to the
>specific file.
>
>For example, the cell contents state : G:
>\folder2007\subfolder0320\00001234.tif
>
>We would like to still have the text in the cell but add to the cell a
>hyperlink that actually points to the file at G:
>\folder2007\subfolder0320\00001234.tif so when we click on the cell it
>will launch our associated image viewing application and view the
>image. We tried creating a macro to do this one call at a time and
>copied the text in the cell to the clipboard and then pasting back in
>as a hyperlinlk. Somehow the cell address gets tagging into this and
>when you run the macro it always jumps back to the original cell the
>macro was written at.
>
>Any way to automate this process or any shortcuts to converting these
>cells to matching hyperlinks????
>
>Any and all help is greatly appreciated,
>Scott
|