Hi,
I have a listview and a list box in 2 different userforms, and when i click on a line of data I am using the followhyperlink command to open the hyperlink in that line. However if the listbox or listview is empty and have no data in, can you stop the follow hyperlink function?
here is my code for each..
LISTVIEW -
LISTBOX -
Help is much appreciated
Thanks
L.
I have a listview and a list box in 2 different userforms, and when i click on a line of data I am using the followhyperlink command to open the hyperlink in that line. However if the listbox or listview is empty and have no data in, can you stop the follow hyperlink function?
here is my code for each..
LISTVIEW -
Code:
Private Sub ListView1_Click()
Dim navigatetoURL As Variant
navigatetoURL = ListView1.SelectedItem.SubItems(1)
ActiveWorkbook.FollowHyperlink Address:=ListView1.SelectedItem.SubItems(1), NewWindow:=True
End Sub
LISTBOX -
Code:
Private Sub ListBox1_Click()
Dim navURL
navURL = ListBox1.Value
ActiveWorkbook.FollowHyperlink Address:=navURL, NewWindow:=True
End Sub
Help is much appreciated
Thanks
L.