0
Thanks

A few words of thanks would be greatly appreciated.

VBA - Setting the AutoFilter function



I have a problem with a macro, I want apply a filter on a field so that when I enter a value from the keyboard, the filtering is done with a condition "other than" cthis setting, for example: when I 'uses a preset such as: Selection.AutoFilter Field:=6, Criteria1:="<>2 , filtering in this case will be made based display any value different from 2.
I do not want a constant value "2" but a value that is entered from the keyboard example:
X = InputBox ("...")
Y = Val(x)
Selection.AutoFilter Field:=6, Criteria1:= "<>y"
Try this:
Criteria1:="<>" & y
Thanks to chossette9 for this tip.
0
Thanks

A few words of thanks would be greatly appreciated.

Ask a question
CCM is a leading international tech website. Our content is written in collaboration with IT experts, under the direction of Jean-François Pillou, founder of CCM.net. CCM reaches more than 50 million unique visitors per month and is available in 11 languages.
This document, titled « VBA - Setting the AutoFilter function », is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (ccm.net).

0 Comments