Autofilter criteria'sHello everyone,<br><br>This might be really simple but I couldn't find the answer for it.What I'm trying to achieve is that I need to find all the possible autofilter criteria's of a single Excel list field (Column) from VBA. I know I could just iterate over the column's cells and distnictly find the values and store them into an array, but I'd really be intrested to know if there is a property which already gives me that.<br><br>thanks,<br>Mohamed<br><br><br>© 2009 Microsoft Corporation. All rights reserved.Thu, 14 May 2009 11:02:55 Zb7059148-1984-464e-92bf-cba947939b6bhttp://social.msdn.microsoft.com/Forums/en-US/isvvba/thread/b7059148-1984-464e-92bf-cba947939b6b#b7059148-1984-464e-92bf-cba947939b6bhttp://social.msdn.microsoft.com/Forums/en-US/isvvba/thread/b7059148-1984-464e-92bf-cba947939b6b#b7059148-1984-464e-92bf-cba947939b6briverofsoulshttp://social.msdn.microsoft.com/Profile/en-US/?user=riverofsoulsAutofilter criteria'sHello everyone,<br><br>This might be really simple but I couldn't find the answer for it.What I'm trying to achieve is that I need to find all the possible autofilter criteria's of a single Excel list field (Column) from VBA. I know I could just iterate over the column's cells and distnictly find the values and store them into an array, but I'd really be intrested to know if there is a property which already gives me that.<br><br>thanks,<br>Mohamed<br><br><br>Thu, 07 Sep 2006 13:11:07 Z2006-09-07T13:11:07Zhttp://social.msdn.microsoft.com/Forums/en-US/isvvba/thread/b7059148-1984-464e-92bf-cba947939b6b#222261c8-8a17-42fb-a810-7d88bd8a60c5http://social.msdn.microsoft.com/Forums/en-US/isvvba/thread/b7059148-1984-464e-92bf-cba947939b6b#222261c8-8a17-42fb-a810-7d88bd8a60c5ChasAAhttp://social.msdn.microsoft.com/Profile/en-US/?user=ChasAAAutofilter criteria's<p>Hello,</p> <p>Something like the following is probably what you are looking for:</p> <p>A1 should have a header for the columns</p> <p>A2 downwards is your data.</p> <p>[code]</p> <p>Sub test()<br> Range(&quot;A1&quot;).Select<br> Selection.AutoFilter<br> srchStr = &quot;test5&quot;<br> Worksheets(&quot;Sheet1&quot;).Range(&quot;A1&quot;).AutoFilter field:=1, _<br> Criteria1:=srchStr, VisibleDropDown:=False<br>End Sub<br></p> <p>Chas</p> <p> </p>Sat, 09 Sep 2006 08:11:33 Z2006-09-09T08:11:33Zhttp://social.msdn.microsoft.com/Forums/en-US/isvvba/thread/b7059148-1984-464e-92bf-cba947939b6b#cc63ba95-dce1-4246-95da-8e760430367ehttp://social.msdn.microsoft.com/Forums/en-US/isvvba/thread/b7059148-1984-464e-92bf-cba947939b6b#cc63ba95-dce1-4246-95da-8e760430367eriverofsoulshttp://social.msdn.microsoft.com/Profile/en-US/?user=riverofsoulsAutofilter criteria'sHi Chas,<br><br>Thanks for your response. Sorry if my question is not clear i'll try to re-word it. What I need to do is that I have a sheet with a list, I need to split this sheet in seperate sheets based on filters of one of the column, assume the column name is &quot;Application&quot;, from the VBA code where I don't know exactly what values might be under that column, I need to iterate over them first, exactly like what the filter arrow does for me which lists all the filter criteria's. So  I basically don't know what are filters and I need to look them up.<br><br>What property in Excel object model can give me this?<br><br>Thanks again:)<br>Sun, 10 Sep 2006 08:03:07 Z2006-09-10T08:03:07Zhttp://social.msdn.microsoft.com/Forums/en-US/isvvba/thread/b7059148-1984-464e-92bf-cba947939b6b#86d2729a-3778-41d9-84fa-d5dd8d9a07eehttp://social.msdn.microsoft.com/Forums/en-US/isvvba/thread/b7059148-1984-464e-92bf-cba947939b6b#86d2729a-3778-41d9-84fa-d5dd8d9a07eeblackmambahttp://social.msdn.microsoft.com/Profile/en-US/?user=blackmambaAutofilter criteria'shey river...,<br>I have the same problem, did you found any solution ???<br>Thanks<br>Wed, 29 Nov 2006 11:42:33 Z2006-11-29T11:42:33Zhttp://social.msdn.microsoft.com/Forums/en-US/isvvba/thread/b7059148-1984-464e-92bf-cba947939b6b#e8bb0507-1e29-4c98-82d1-71f778bd8406http://social.msdn.microsoft.com/Forums/en-US/isvvba/thread/b7059148-1984-464e-92bf-cba947939b6b#e8bb0507-1e29-4c98-82d1-71f778bd8406ADGhttp://social.msdn.microsoft.com/Profile/en-US/?user=ADGAutofilter criteria's<p>Hi</p> <p>You could always store the unique values of a column in a collection, below runs down column A until it hits a blank, then lists unique entries in the debug window:</p> <p> </p> <p>Public Sub Listing()<br>Dim x As Long<br>Dim strList As New Collection<br>x = 1<br>With Worksheets(&quot;Sheet1&quot;)<br>While Len(.Cells(x, 1).Value) &gt; 0<br>        On Error Resume Next<br>        strList.Add Item:=.Cells(x, 1).Value, key:=.Cells(x, 1).Value<br>        On Error GoTo 0<br>    x = x + 1<br>Wend<br>End With<br>If strList.Count &gt; 1 Then<br>    For x = 1 To strList.Count<br>        Debug.Print strList(x)<br>    Next<br>End If<br>Set strList = Nothing<br>End Sub<br></p>Wed, 29 Nov 2006 12:26:44 Z2006-11-29T12:26:44Zhttp://social.msdn.microsoft.com/Forums/en-US/isvvba/thread/b7059148-1984-464e-92bf-cba947939b6b#63ec183a-a2d1-40ca-a343-d14b637fd6echttp://social.msdn.microsoft.com/Forums/en-US/isvvba/thread/b7059148-1984-464e-92bf-cba947939b6b#63ec183a-a2d1-40ca-a343-d14b637fd6ecblackmambahttp://social.msdn.microsoft.com/Profile/en-US/?user=blackmambaAutofilter criteria'shey good ideea,<br>Found something else when pressing the F1 magic key:<br><br>Columns(&quot;A:A&quot;).Select<br>Selection.AdvancedFilter Action:=xlFilterInPlace, Unique:=True<br><br>Wed, 29 Nov 2006 12:49:30 Z2006-11-29T12:49:30Zhttp://social.msdn.microsoft.com/Forums/en-US/isvvba/thread/b7059148-1984-464e-92bf-cba947939b6b#7307c32b-cbf2-4a74-a132-2da0f37ffdbbhttp://social.msdn.microsoft.com/Forums/en-US/isvvba/thread/b7059148-1984-464e-92bf-cba947939b6b#7307c32b-cbf2-4a74-a132-2da0f37ffdbbcircuitman06http://social.msdn.microsoft.com/Profile/en-US/?user=circuitman06Autofilter criteria'sHello ChasAA,<br/><br/>When excel shows the &quot;test&quot; filtered rows how can I copy all of them to a seperate sheet? I need to select all of test5 filtered rows and then copy to them to another sheet.<br/><br/>Dim srchStr As String<br/> <br/> <br/> Range(&quot;A11&quot;).Select<br/> Selection.AutoFilter<br/> srchStr = &quot;CL15&quot;<br/> Worksheets(&quot;Nisan1&quot;).Range(&quot;A1&quot;).AutoFilter field:=11, _<br/> Criteria1:=srchStr, VisibleDropDown:=False<br/> Selection.Copy??????????<br/> Sheets.Add<br/> ActiveSheet.PasteThu, 14 May 2009 09:06:20 Z2009-05-14T09:06:20Zhttp://social.msdn.microsoft.com/Forums/en-US/isvvba/thread/b7059148-1984-464e-92bf-cba947939b6b#496a25fa-f376-425b-bbc9-d5fcb1564c5bhttp://social.msdn.microsoft.com/Forums/en-US/isvvba/thread/b7059148-1984-464e-92bf-cba947939b6b#496a25fa-f376-425b-bbc9-d5fcb1564c5bcircuitman06http://social.msdn.microsoft.com/Profile/en-US/?user=circuitman06Autofilter criteria'sI've found the answer Thank you for all,,<br/>Thu, 14 May 2009 11:02:55 Z2009-05-14T11:02:55Z