I didnt think it was worth while making a new post as my question is on theback of this.
I have another excel sheet that I want to create a list box. I have used the above code, but chnaged the range to the correct one
Sub Listbox1_Click()
On Error GoTo Errorcatch
Dim rngData As Range
Dim lngIndex As Long
Dim objList As ListBox
Set rngData = Range("AHT source data!$f$5:$Ab$11")
Set objList = ActiveSheet.ListBoxes("List Box 4")
For lngIndex = 1 To objList.ListCount
rngData.Rows(lngIndex).Hidden = Not objList.Selected(lngIndex)
Next
Errorcatch:
MsgBox Err.Description
End Sub
It wouldn't work so I included an error catch and the error i keep getting is:
method 'range' of object '_worksheet' failed
Am i doing something drastically wrong?
Bookmarks