littlepete
Well-known Member
- Joined
- Mar 26, 2015
- Messages
- 507
- Office Version
- 365
- Platform
- Windows
hello all
for me this is a real mysterie :
i have a macro that partially functions perfectly: it uses autofilter to get all rows that contain " FAM..." in the column CC.
when i use the CONTROL-i function key it works perfect !
The macro looks like this :
but, i am adding macro functionality to my third row, and assigned this macro to cell D3, as you can see below:
Each time that i try the family filter, that looks at the six first letters of column CC (FAM + three letters) the result is always 81 ... !
and 81 is exactly the number of the 81thd column, being CC !!!
how can that be ?
thank you for breaking your brain on this !
for me this is a real mysterie :
i have a macro that partially functions perfectly: it uses autofilter to get all rows that contain " FAM..." in the column CC.
when i use the CONTROL-i function key it works perfect !
The macro looks like this :
VBA Code:
Sub familiefilter() ' ---------------------------------------------------------------------------------- ctrl - i
Application.ScreenUpdating = False
Dim dezerij As Long
dezerij = ActiveCell.Row
Dim dezefam As String
dezefam = Left(Sheets("gegevens").Range("cc" & dezerij).Value, 6)
ActiveSheet.Range("A:A").AutoFilter Field:=81, Criteria1:= _
"=*" & Left(Sheets("gegevens").Range("cc" & dezerij).Value, 6) & "*", Operator:=xlAnd
Application.ScreenUpdating = True
tooneersterij
End Sub
but, i am adding macro functionality to my third row, and assigned this macro to cell D3, as you can see below:
VBA Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Selection.Count = 1 Then
If Not Intersect(Target, Range("F3")) Is Nothing Then
Call filteruit
Range("a5").Select
End If
If Not Intersect(Target, Range("E3")) Is Nothing Then
Call volledigscherm
End If
If Not Intersect(Target, Range("D3")) Is Nothing Then
Call familiefilter
End If
End If
Application.OnKey "{F3}", "datumfilterx"
Application.OnKey "{F5}", "datumfilter"
Application.OnKey "{F8}", "allerijhoogtenaanpassen"
Application.OnKey "{F10}", "standardview"
Application.OnKey "{F11}", "volledigscherm2"
Application.OnKey "{F12}", "box"
End Sub
Each time that i try the family filter, that looks at the six first letters of column CC (FAM + three letters) the result is always 81 ... !
and 81 is exactly the number of the 81thd column, being CC !!!
how can that be ?
thank you for breaking your brain on this !