ShawnExcel
Member
I am currently attempting to sort a large table based on a dropdown on another page using Worksheet_change. I have attached an example. This works about 50% of the time but it errors out half the time. Does anyone know why?
Error:
Unable to get the Match Property of the WorksheetFunction Class
Here is the code:
My GOAL is to be able to select a dropdown option (i.e. BEEF) and have the table on the next page filter so only "YES" is shown for Beef (i.e. filter out any "No" rows for the selected food).
Can anyone help with this?
Thank you so much!
Error:
Unable to get the Match Property of the WorksheetFunction Class
Here is the code:
Code:
Private Sub Worksheet_Change(ByVal Facility_Type As Range)
If Facility_Type.Address = ActiveWorkbook.Sheets(1).Range("C4").Address Then
FacilityRange = Worksheets("Sheet1").Range("A2:H2").Value
MsgBox (Facility_Type)
MatchedCell = Application.WorksheetFunction.Match(Facility_Type, FacilityRange)
MsgBox (MatchedCell)
Else
MsgBox ("Range Not Found")
End If
End Sub
My GOAL is to be able to select a dropdown option (i.e. BEEF) and have the table on the next page filter so only "YES" is shown for Beef (i.e. filter out any "No" rows for the selected food).
Can anyone help with this?
Thank you so much!
Attachments
Last edited: