Hi all,
I am trying to make a multi item filter, 4 combo boxes, each with a dynamic named range for the rowsource, selecting any value in 1 box will reduce the options in the other 3 until you get down to a final selection.
I have tried to use the Combobox_Change event to add a filter criteria and then re-run the filter macro which then generates the 4 named ranges, it works up to this point.
I am assuming that because the named range changes it then fires the change event again, at this point the filter code comes back with an error.
I am trying to make a multi item filter, 4 combo boxes, each with a dynamic named range for the rowsource, selecting any value in 1 box will reduce the options in the other 3 until you get down to a final selection.
I have tried to use the Combobox_Change event to add a filter criteria and then re-run the filter macro which then generates the 4 named ranges, it works up to this point.
I am assuming that because the named range changes it then fires the change event again, at this point the filter code comes back with an error.
Code:
Sub InitialFilter()
Sheets("Filtered Equipment").Select
Sheets("Equipment").Columns("A:D").AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Range("A1:D2"), CopyToRange:=Columns("F:I"), Unique:=True
Columns("F:F").Select
Columns("F:F").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Range( _
"A3"), CopyToRange:=Columns("K:K"), Unique:=True
Columns("G:G").AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Columns( _
"L:L"), Unique:=True
Columns("H:H").AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Columns( _
"M:M"), Unique:=True
Columns("I:I").AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Columns( _
"N:N"), Unique:=True
Range("L65536").End(xlUp).Select
CurrentCell = ActiveCell.Address
Range("L2:" & CurrentCell).Name = "AREA"
Range("M65536").End(xlUp).Select
CurrentCell = ActiveCell.Address
Range("M2:" & CurrentCell).Name = "TYPE"
Range("N65536").End(xlUp).Select
CurrentCell = ActiveCell.Address
Range("N2:" & CurrentCell).Name = "ID"
Range("K65536").End(xlUp).Select
CurrentCell = ActiveCell.Address
Range("K2:" & CurrentCell).Name = "SYSTEM"
End Sub