Filter event

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
 
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

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top