New to VBA and would greatly appreciate assistance.
Using Excel 2010 and modifying code found online.
I have created a userform which contains Listbox populated from another table. Listbox is multiselect.
I need to filter table to view rows based on user-selected item(s) from Listbox. Here is what does not work....
Private Sub ProjEngCommand_Click()
Dim Criteria As String
Dim i As Variant
' Build criteria string from selected items in list box.
Criteria = ""
For Each i In Me![ProjEngFilter].ItemSelected
If Criteria <> "" Then
Criteria = Criteria & " OR "
End If
Criteria = Criteria & "[ResEng]='" _
& Me![ProjEngFilter].ItemData(i) & "'"
Next i
' Filter the form using selected items in the list box.
Me.Filter = Criteria
Me.FilterOn = True
End Sub
This error message refers to ".Filter" in debug
Compile error:
Method or data member not found
Bookmarks