ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Filter problem (https://www.excelbanter.com/excel-worksheet-functions/57645-filter-problem.html)

[email protected]

Filter problem
 
A combobox contains the following code:

Private Sub cbCAT_Change()
Filtercolumn = 12
If cbCAT < "" Then
Selection.AutoFilter Field:=Filtercolumn, Criteria1:="=" &
cbCAT
Else
Selection.auofilter Field:=Filtercolumn
End If

End Sub

Problem
When cbCAT < "" then a filter is set according to the value of cbCAT.
That works just fine.

When the user blanks the value and cbCAT = "" I want to set the filter
off. When I do it manually in the worksheet, it works fine. However,
then I do it here in the macro, I get an error message.

Anybody know whe?

Glen


DOR

Filter problem
 
Could it be because you have spelled "AutoFilter" incorrectly in the
statement following Else, e.g.

Selection.auofilter Field:=Filtercolumn

??

DOR



All times are GMT +1. The time now is 07:04 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com