View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
 
Posts: n/a
Default Filter isn't working with a VBA Code

I didn't do this because it has to filter automaticly alle the 0 and
the C out of the sheet, and then hide them.

Now my filter is not filtering correcty but my code is working
correcty.

The filter is not working in combination with a code it is look like.

Don Guillett schreef:

Why not use datafiltercustomdoes not equal O and does not equal C.
record the macro

--
Don Guillett
SalesAid Software

wrote in message
oups.com...
Can anyone help me with this problem:

I use a code in my excel sheet to hide rows when there is a "0" (zero)
or a "C" is in a cell in the colomn. Now when I use my auto filter,
it's not filtering anything!


This is how (a part of) my sheet looks:


1 C
1 H
2 M
2 T
3 K
3 H
4 0


This is how the code lookslike:


Dim X As Boolean


Private Sub Worksheet_Calculate()
Dim R As Long
If X = True Then Exit Sub
X = True
For R = 1 To Cells(65535, 3).End(xlUp).Row
Select Case Cells(R, 3).Value
Case "", 0, "C"
Me.Rows(R).Hidden = True
Case Else
Me.Rows(R).Hidden = False
End Select
Next
X = False
End Sub


What I want is to use the auto filter on the rows, but if I do this
now, the filter does not filter anything!


Who can help with this problem?


Greets, Berry