Filter event

  • Thread starter Thread starter jodleren
  • Start date Start date
J

jodleren

Hi all

How can I catch a filter event?

I found, that there is no such event, but I rely on, that someone has
invented something...

WBR
Sonnich
 
Hi all

How can I catch a filter event?

I found, that there is no such event, but I rely on, that someone has
invented something...

WBR
Sonnich

Well, I came up with this:

Private Sub Workbook_SheetCalculate(ByVal Sh As Object)
Dim iHidden, iRow As Integer
Dim ws As Worksheet

If Worksheets("BOM").Cells(1, 28).Value = "" Then
Worksheets("BOM").Cells(1, 28).Value = "X" // check whether we
are running
Application.ScreenUpdating = False
Application.DisplayAlerts = False

With Worksheets("BOM")
' find plase to store hidden data
iHidden = 1
While .Cells(6, iHidden).Text <> ""
iHidden = iHidden + 1
Wend

iRow = 7
While .Cells(iRow, 1).Value <> ""
If .Cells(iRow, iHidden).Value <> "" Then // if row is marked,
then hide it
.Rows(iRow).Hidden = True
End If
iRow = iRow + 1
Wend
End With

Application.ScreenUpdating = True
Application.DisplayAlerts = True
Worksheets("BOM").Cells(1, 28).Value = "" // we are done
End If
End Sub
 
Back
Top