PDA

View Full Version : Listbox items as Hyperlinks



elyfrank
10-21-2017, 03:24 PM
Hi Guys,
Is there any way I can make the items in a list box clickable hyperlinks so the users open the files they want. I already have a button that opens all the items with a single click using. ActiveWorkbook.FollowHyperlink filenames(i) with no problem.
Thank you very much.
This is the code for the Listbox which shows the items I want:


Sub Hyperlinks_List()
For i = 3 To Number_projects
If filenames(i) <> "NO" Then
With Hyperlinks
.AddItem (Replace(filenames(i), Path, ""))
End With
End If
Next i
End Sub

elyfrank
10-21-2017, 03:42 PM
I just did this and it is working great, maybe this will help somebody out there.

Private Sub Hyperlinks_Click()
For i = 3 To Number_projects
If Hyperlinks.Selected(i - 3) Then
ActiveWorkbook.FollowHyperlink filenames(i)
End If
Next i
End Sub