Originally Posted by danovkos
The activecell.column is the column nummber, as you know. The Field is the count from the left of the Filter Range, so Filtering E-H, Column F is Field 2, ActiveCell.Column is 6. This is catered for in my last posts.
Originally Posted by danovkos
The activecell.column is the column nummber, as you know. The Field is the count from the left of the Filter Range, so Filtering E-H, Column F is Field 2, ActiveCell.Column is 6. This is catered for in my last posts.
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
no, doesnt works
if i turned off autofilter and turned on it only for a f.e. column B
it does what i wrote before. It filtering next column not active column
??? why
For clarity, to which post are you responding?Originally Posted by danovkos
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
Danovkos, please make some efforts as i explained in a previous post to post your workbook!
Regards,
Simon
Please read this before cross posting!
In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
If I have seen further it is by standing on the shoulders of giants.
Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)
Have you tried stepping through the code to identify the error?
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
i tried it but it doesnt effect, because of the code for me doesnt works for atached filters.xls too.Originally Posted by Simon Lloyd
As i wrote.
It works when i open it, but if i change the autofilter only for a part of table, it stops works and filtering column next active, not active.
i am really sorry for lost your time i only try to fix my codes
yes, but it doesnt show any error. It only after chagne of filter filtering other column as i need.Originally Posted by mdmackillop
Which version of Excel are you using? Not that I think it should make a difference.
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
Office 2003 with SP3Originally Posted by mdmackillop
I can test in that later.
One last attempt for now. Try this version in the Userform example
[VBA]
Sub Filtering2(Flt As String)
Dim FiltRng As Range
Dim Col As Long
Set FiltRng = ActiveSheet.AutoFilter.Range
Col = Selection.Column - FiltRng(1).Column + 1 '<++++++++++++
If FiltRng.Columns.Count = 1 And Col = 0 Then Col = 1
FiltRng.AutoFilter field:=Col, Criteria1:=Flt
End Sub
[/VBA]
If that fails, try changing the indicated 1 value to 0 to see if it helps
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
I've tried this in 2003 and 2007 and it works in both. Some error handling has been added. If this isn't it, I don't know what else to suggest.
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
yes, yes, yes
it works perfec...and the second code with useform is great too. I give there my most used criteria and will always use it )
thanke you very very much to all.