I'm trying to filter the values of column one. The price under the filter is different every time is there any way that the macro can capture it.
Sub Macro 1 () Sheets ("Open"). Choose less than 0 invoice values. ActiveSheet.Range ("$ A $ 1: $ R $ 2700") Auto Filter Field: = 11, Criteria1:. = "& Lt; 0", _ operator: = xlAnd 'Selected Country ActiveSheet.Range ("$ A $ 1: $ R $ 2700") Auto Filter Field: = 3, Criteria1. : = "ARG" 'Selected invoice # ActiveSheet.Range ("$ A $ 1: $ R $ 2700") Auto Filter Field:. = 7, Criteria1 :. = "1,007,225" category ("G528") Select ActiveSheet.Range ("$ A $ 1: $ R $ 2700") Auto Filter Field:. = 7, Criteria1: = "1,015,678" ActiveSheet.Range ("$ A $ 1: $ R $ 2700".) Auto Filter Field: = 7, Criteria1: = "1,018,523" range ("G1"). Choose ActiveSheet.Range ("$ A $ 1: $ R $ 2700"). AutoFilter Field: = 7, Criteria 1: = "1018962" end sub
stuff your . Find the set using the AutoFilter
field in the Nested Variant array and by using Rank . With LBound
and UBound
.
sub a1Multi_Filter () as Dim V Long, vCRITs version as dim vKey version, dCOL7s New Scripting.Dictionary dCOL7s.CompareMode = BinaryCompare vCRITs = array (array as 11 , Array (7, "1015678"), _ Array (7, "1018523", "Array"), _ Array (3, "ARAG"), _ Array (7, "1007225"), _ ), _Arere (7, "1018962") for ActiveSheet.Cells (1, 1) V.CurrentRegion .AutoFilter = LBound (vCRITs, 1) to UBound (vCRITs, 1) .AutoFilter field: = vCRITs (v ) (0), Criteria1: = vCRITs (v) (1) "Pause and processing for effect" MSBBX "array presets" & amp; Chr (10) & "Filt ("0") & amp; "for" & amp; VCRITs (v) (1); & amp; nbsp; (0, 0) & amp; "On the Columns" & amp; Crow (64 + VCRTS (V) ) .AutoFilter field: = vCRITs (v) (0) Next v. AutoFilter for v = 2 .Rows.Count if cinchool (lane (V, 7). Value) and not dCOL7s.Exists (.csells (v , 7) .Value) then _dCOL7s.Add key: = cells (v, 7) .Value, Item: for each vKey = 7 Next to V. dCOL7s.Keys' V = 0 (DCOL 7. Number -1). Autofilter field: = DCOL 7 Item (VKA), Criterion 1: = Message for Pause and Processing for Effects Box "Column 7 Special" & amp; Chr (10) & amp; "Filtered" & amp; . Leaf (0, 0) & amp; "On column" & amp; Crow (64 + DCOL 7. Item (VKA) & amp; "For" & amp; VKey .AutoFilter Field: = dCOL7s.Item (vKey) with the next vKey end dCOL7s.RemoveAll: Set dCOL7s = Something End
I leave you many rooms for processing and messaging The text should be used to help explain the elements of the variant array (A).
After setting field arguments and set criteria for the criteria, uses for ... next
loop for the limitations of the processing of lower and upper limitations of the first rank . Each set has been applied in turn and I stopped it with an Assembled box, showing the AutoFilter category, filtered field and filter criteria. After 'processing', auto filters for the area are cleared in preparation for the next.
Appendix:
I added the unique items in a scripting dictionary from the collection column, and then each key has the same . AutoFilter is bicycle through the document key and item, using filters and criteria as the
. To use a scripting dictionary, you should go to VBE's device ► References and add Microsoft scripting runtime to the project. It should be added only once; Not for every computer that it can run but if a new project has been started which uses a scripting dictionary, then that project should also be added.
No comments:
Post a Comment