Pasting a value as an hyperlink

  • Thread starter Thread starter The Rook
  • Start date Start date
T

The Rook

I have imported a list from a database of file paths to documents on our
server, these data is currently formatted as 'General'

Is there anyway of converting that value into a hyperlink to the said
documents?
 
If your list is the complete path and file name, then in an adjacent
column you could just do:

=HYPERLINK(A1)

and copy this down.

If you wish to you could fix the values and then you would not need
column A.

Hope this helps.

Pete
 
Select the range that you want to make into hyperlinks and use this macro.
'/==============================/
Sub HyperlinkMake()
'create hyperlink from cell contents
'Gary Brown - Kinneson LLC
'07/07/2005
Dim rngCell As Range

On Error Resume Next

'if no cells have been selected then stop
If Selection.Count = 0 Then
GoTo err_Sub
End If

For Each rngCell In Selection
'check that selection is within used range of worksheet
If TypeName(Application.Intersect(rngCell, _
(ActiveSheet.UsedRange))) = "Nothing" Then
Exit For
End If
If rngCell.Hyperlinks.Count = 0 And _
Len(rngCell.value) <> 0 Then
ActiveSheet.Hyperlinks.Add _
Anchor:=rngCell, Address:= _
rngCell.value, TextToDisplay:=rngCell.value
End If
Next rngCell


exit_Sub:
Exit Sub
err_Sub:
GoTo exit_Sub

End Sub
'/==============================/
 
Back
Top