automatically assign a hyperlink to a cell

  • Thread starter Thread starter Brad J.
  • Start date Start date
B

Brad J.

I have a database in which I am storing information and assigning a ID
number to each entry. From those entries, a report is generated and
saved to a designated directory on my server. I would like to somehow
automatically assign a hyperlink to that forms ID number in the
database so that anyone can simply click on the hyperlink and pull up
the form.

Basically I need to do a find last row command and place the hyperlink
in the ID number cell. The hyperlinks will always go to the same
directory, but the variable would obviously be the form ID number.

Is there a way to do this or even if I have to place a hyperlink in
each cell using a directory reference from another cell would work,
but I am having trouble with the variable working.

Thanks for any advice,
Brad
 
Instead of a hyperlink why not just use a double click event in the sheet
module. Right click sheet tab>view code>insert this. This example uses a
typed name of a worksheet to goto to it.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
Application.DisplayAlerts = False
Dim WantedSheet As String
WantedSheet = Trim(ActiveCell.Value)
If WantedSheet = "" Then Exit Sub
On Error Resume Next
If Sheets(ActiveCell.Value) Is Nothing Then
GetWorkbook ' calls another macro to do that
Else
Sheets(ActiveCell.Value).Select
ActiveSheet.Range("a4").Select
End If
Application.DisplayAlerts = True
End Sub
 
Back
Top