<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Advanced Filtering in VBA</title>
	<atom:link href="http://www.dailydoseofexcel.com/archives/2004/11/22/advanced-filtering-in-vba/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dailydoseofexcel.com/archives/2004/11/22/advanced-filtering-in-vba/</link>
	<description>Daily posts of Excel tips…and other stuff</description>
	<lastBuildDate>Wed, 08 Feb 2012 23:58:05 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Leby66</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/11/22/advanced-filtering-in-vba/#comment-67639</link>
		<dc:creator>Leby66</dc:creator>
		<pubDate>Thu, 03 Nov 2011 15:18:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=875#comment-67639</guid>
		<description>&lt;p&gt;Sorry, whole code did not appear. I am using AutoFilter to do filtering.&lt;/p&gt;
&lt;p&gt;&lt;&lt;br&gt;
Set WS = Sheets(&quot;COSHOCTON&quot;) &#039;&lt;&lt;&lt; Change as needed&lt;br&gt;
Set rng = WS.Range(&quot;A4:Z100?) &#039;&lt;&lt;&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Sorry, whole code did not appear. I am using AutoFilter to do filtering.</p>
<p>&lt;<br />
Set WS = Sheets(&#8220;COSHOCTON&#8221;) &#8216;&lt;&lt;&lt; Change as needed<br />
Set rng = WS.Range(&#8220;A4:Z100?) &#8216;&lt;&lt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Leby66</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/11/22/advanced-filtering-in-vba/#comment-67638</link>
		<dc:creator>Leby66</dc:creator>
		<pubDate>Thu, 03 Nov 2011 15:05:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=875#comment-67638</guid>
		<description>&lt;p&gt;Please Help!&lt;/p&gt;
&lt;p&gt;I am very new to VB coding. I have the following code, crude as it may be, to filter one sheet and copy data to another workbook sheet.&lt;br&gt;
I would like it to only copy the first 4 colums (cells) in the row found. Everytime I change the copy argument from EntireRow to anything&lt;br&gt;
else it gives me an error.&lt;/p&gt;
&lt;p&gt;Thanks in advance for any help&lt;/p&gt;
&lt;p&gt;Sub Test2()&lt;/p&gt;
&lt;p&gt;Dim WS As Worksheet&lt;br&gt;
Dim WSNew As Worksheet&lt;br&gt;
Dim rng As Range&lt;br&gt;
Dim Str As String&lt;br&gt;
Dim wbk As Workbook&lt;/p&gt;
&lt;p&gt;&#039;strFirstFile = &quot;c:	empPavement MarkingTest.xlsm&quot;&lt;br&gt;
strSecondFile = &quot;c:	emp2012 Fast Dry Test.xlsm&quot;&lt;/p&gt;
&lt;p&gt;Set WS = Sheets(&quot;COSHOCTON&quot;) &#039;&lt;&lt;&lt; Change as needed&lt;br&gt;
Set rng = WS.Range(&quot;A4:Z100?) &#039;&lt;&lt; 0 Then&lt;/p&gt;
&lt;p&gt;Err.Clear&lt;br&gt;
End If&lt;br&gt;
On Error GoTo 0&lt;/p&gt;
&lt;p&gt;End Sub&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Please Help!</p>
<p>I am very new to VB coding. I have the following code, crude as it may be, to filter one sheet and copy data to another workbook sheet.<br />
I would like it to only copy the first 4 colums (cells) in the row found. Everytime I change the copy argument from EntireRow to anything<br />
else it gives me an error.</p>
<p>Thanks in advance for any help</p>
<p>Sub Test2()</p>
<p>Dim WS As Worksheet<br />
Dim WSNew As Worksheet<br />
Dim rng As Range<br />
Dim Str As String<br />
Dim wbk As Workbook</p>
<p>&#8216;strFirstFile = &#8220;c:	empPavement MarkingTest.xlsm&#8221;<br />
strSecondFile = &#8220;c:	emp2012 Fast Dry Test.xlsm&#8221;</p>
<p>Set WS = Sheets(&#8220;COSHOCTON&#8221;) &#8216;&lt;&lt;&lt; Change as needed<br />
Set rng = WS.Range(&#8220;A4:Z100?) &#8216;&lt;&lt; 0 Then</p>
<p>Err.Clear<br />
End If<br />
On Error GoTo 0</p>
<p>End Sub</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mohsin</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/11/22/advanced-filtering-in-vba/#comment-55373</link>
		<dc:creator>Mohsin</dc:creator>
		<pubDate>Fri, 03 Dec 2010 19:59:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=875#comment-55373</guid>
		<description>&lt;p&gt;works like a charm!!&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>works like a charm!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Luke</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/11/22/advanced-filtering-in-vba/#comment-53127</link>
		<dc:creator>Luke</dc:creator>
		<pubDate>Mon, 25 Oct 2010 14:35:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=875#comment-53127</guid>
		<description>&lt;div style=&quot;overflow: auto; white-space: nowrap;&quot; class=&quot;codecolorer-container vb default&quot;&gt;&lt;div style=&quot;white-space: nowrap;&quot; class=&quot;vb codecolorer&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; ApplyFilter()&lt;br&gt;
&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; rngCriteria &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; Range&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; rngFilter &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; Range&lt;br&gt;
&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Set&lt;/span&gt; rngCriteria = Sheets(&lt;span class=&quot;st0&quot;&gt;&quot;CLIENT FILTER&quot;&lt;/span&gt;).Range(&lt;span class=&quot;st0&quot;&gt;&quot;FilterCriteria&quot;&lt;/span&gt;)&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Set&lt;/span&gt; rngFilter = Sheets(&lt;span class=&quot;st0&quot;&gt;&quot;DATA&quot;&lt;/span&gt;).Range(&lt;span class=&quot;st0&quot;&gt;&quot;FilterRange&quot;&lt;/span&gt;)&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
rngFilter.AdvancedFilter _&lt;br&gt;
&#160; &#160; Action:=xlFilterInPlace, _&lt;br&gt;
&#160; &#160; CriteriaRange:=rngCriteria&lt;br&gt;
&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;&lt;br&gt;
&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; ShowAll()&lt;br&gt;
&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt; Worksheets(&lt;span class=&quot;st0&quot;&gt;&quot;DATA&quot;&lt;/span&gt;).FilterMode = &lt;span class=&quot;kw1&quot;&gt;False&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Then&lt;/span&gt;&lt;br&gt;
MsgBox &lt;span class=&quot;st0&quot;&gt;&quot;There are no filters applied&quot;&lt;/span&gt;&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Else&lt;/span&gt;&lt;br&gt;
Worksheets(&lt;span class=&quot;st0&quot;&gt;&quot;DATA&quot;&lt;/span&gt;).ShowAllData&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt;&lt;br&gt;
&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
</description>
		<content:encoded><![CDATA[<div style="overflow: auto; white-space: nowrap;" class="codecolorer-container vb default">
<div style="white-space: nowrap;" class="vb codecolorer"><span class="kw1">Sub</span> ApplyFilter()</p>
<p><span class="kw1">Dim</span> rngCriteria <span class="kw1">As</span> Range<br />
<span class="kw1">Dim</span> rngFilter <span class="kw1">As</span> Range</p>
<p><span class="kw1">Set</span> rngCriteria = Sheets(<span class="st0">&#8220;CLIENT FILTER&#8221;</span>).Range(<span class="st0">&#8220;FilterCriteria&#8221;</span>)<br />
<span class="kw1">Set</span> rngFilter = Sheets(<span class="st0">&#8220;DATA&#8221;</span>).Range(<span class="st0">&#8220;FilterRange&#8221;</span>)</p>
<p>
rngFilter.AdvancedFilter _<br />
&nbsp; &nbsp; Action:=xlFilterInPlace, _<br />
&nbsp; &nbsp; CriteriaRange:=rngCriteria</p>
<p><span class="kw1">End</span> <span class="kw1">Sub</span></p>
<p><span class="kw1">Sub</span> ShowAll()</p>
<p><span class="kw1">If</span> Worksheets(<span class="st0">&#8220;DATA&#8221;</span>).FilterMode = <span class="kw1">False</span> <span class="kw1">Then</span><br />
MsgBox <span class="st0">&#8220;There are no filters applied&#8221;</span><br />
<span class="kw1">Else</span><br />
Worksheets(<span class="st0">&#8220;DATA&#8221;</span>).ShowAllData<br />
<span class="kw1">End</span> <span class="kw1">If</span></p>
<p><span class="kw1">End</span> <span class="kw1">Sub</span></div>
</div>
]]></content:encoded>
	</item>
	<item>
		<title>By: Luke</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/11/22/advanced-filtering-in-vba/#comment-53126</link>
		<dc:creator>Luke</dc:creator>
		<pubDate>Mon, 25 Oct 2010 14:33:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=875#comment-53126</guid>
		<description>&lt;p&gt;And the filter criteria cannot contain blanks!&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>And the filter criteria cannot contain blanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Luke</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/11/22/advanced-filtering-in-vba/#comment-53124</link>
		<dc:creator>Luke</dc:creator>
		<pubDate>Mon, 25 Oct 2010 14:32:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=875#comment-53124</guid>
		<description>&lt;p&gt;This code does work! Anybody who says it doesn&#039;t probably haven&#039;t set their ranges properly&lt;/p&gt;
&lt;p&gt;The header must be included for the criteria and the filter range! How else would excel be able to match the fields with the filters.&lt;/p&gt;
&lt;p&gt;I have just tested this method, and used it for my own purposes, runs very fast and very flexible&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>This code does work! Anybody who says it doesn&#8217;t probably haven&#8217;t set their ranges properly</p>
<p>The header must be included for the criteria and the filter range! How else would excel be able to match the fields with the filters.</p>
<p>I have just tested this method, and used it for my own purposes, runs very fast and very flexible</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mr. M</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/11/22/advanced-filtering-in-vba/#comment-49797</link>
		<dc:creator>Mr. M</dc:creator>
		<pubDate>Fri, 03 Sep 2010 17:01:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=875#comment-49797</guid>
		<description>&lt;p&gt;This snippet - Looks like exactly what I was looking for when google search results brought me to this page so thanks to all who contributed it:&lt;br&gt;
sub toggle_dataFilters_onOff&lt;/p&gt;
&lt;p&gt;If Worksheets(&quot;Sheet1?).FilterMode = True Then&lt;br&gt;
    MsgBox &quot;Filter mode is on&quot;&lt;br&gt;
Else&lt;br&gt;
    MsgBox &quot;Filter mode is off&quot;&lt;br&gt;
End If&lt;/p&gt;
&lt;p&gt;FYI -- I don&#039;t have a copy of the old code I used to use, but I think under office 97/2003 Excel, there may have been a different property.  As I no longer have access to the older software, I can only verify this works on Office 2007 (even in XLS sheets that are supposedly compatible with the older release).  Past experience shows you must test code in each release you plan to use it, otherwise the unexpected can occur.  &lt;/p&gt;
&lt;p&gt;But in the spirit of sharing - here&#039;s what I did with above code to use it in my sheet and a little explanation on it:&lt;/p&gt;
&lt;p&gt;Sub toggle_dataFilters_OnOff()&lt;br&gt;
&#039; To use this code - create a replacement for goTo_startOfProdCol or simply put in a range that positions&lt;br&gt;
&#039;                    the active cell to start of first column in your sheet&lt;/p&gt;
&lt;p&gt;&#039; this sub activates the &quot;data area&quot; of a workbook where all sheets have the same continuous data area&lt;br&gt;
&#039; starting with a &quot;products column&quot;.  relative references make the macro re-usable on any sheet of same setup&lt;br&gt;
&#039; If condition will turn filters off if filter is already on&lt;br&gt;
&#039; code is then called by button called &quot;Turn filters on/off&quot; re-used on each sheet of the workbook:&lt;/p&gt;
&lt;p&gt;    If ActiveSheet.FilterMode = True Then&lt;br&gt;
        &#039; MsgBox &quot;Filter mode is on&quot;&lt;/p&gt;
&lt;p&gt;        goTo_startOfProdCol&lt;br&gt;
        &#039; this is my own sub - positions activecell at top of my &quot;products&quot; column&lt;br&gt;
        Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select&lt;br&gt;
        &#039; this extends to end of sheet - where my data area ends&lt;/p&gt;
&lt;p&gt;        Selection.AutoFilter&lt;br&gt;
    Else&lt;br&gt;
        &#039; MsgBox &quot;Filter mode is off&quot;&lt;/p&gt;
&lt;p&gt;        Selection.AutoFilter&lt;br&gt;
    End If&lt;/p&gt;
&lt;p&gt;End Sub&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>This snippet &#8211; Looks like exactly what I was looking for when google search results brought me to this page so thanks to all who contributed it:<br />
sub toggle_dataFilters_onOff</p>
<p>If Worksheets(&#8220;Sheet1?).FilterMode = True Then<br />
    MsgBox &#8220;Filter mode is on&#8221;<br />
Else<br />
    MsgBox &#8220;Filter mode is off&#8221;<br />
End If</p>
<p>FYI &#8212; I don&#8217;t have a copy of the old code I used to use, but I think under office 97/2003 Excel, there may have been a different property.  As I no longer have access to the older software, I can only verify this works on Office 2007 (even in XLS sheets that are supposedly compatible with the older release).  Past experience shows you must test code in each release you plan to use it, otherwise the unexpected can occur.  </p>
<p>But in the spirit of sharing &#8211; here&#8217;s what I did with above code to use it in my sheet and a little explanation on it:</p>
<p>Sub toggle_dataFilters_OnOff()<br />
&#8216; To use this code &#8211; create a replacement for goTo_startOfProdCol or simply put in a range that positions<br />
&#8216;                    the active cell to start of first column in your sheet</p>
<p>&#8216; this sub activates the &#8220;data area&#8221; of a workbook where all sheets have the same continuous data area<br />
&#8216; starting with a &#8220;products column&#8221;.  relative references make the macro re-usable on any sheet of same setup<br />
&#8216; If condition will turn filters off if filter is already on<br />
&#8216; code is then called by button called &#8220;Turn filters on/off&#8221; re-used on each sheet of the workbook:</p>
<p>    If ActiveSheet.FilterMode = True Then<br />
        &#8216; MsgBox &#8220;Filter mode is on&#8221;</p>
<p>        goTo_startOfProdCol<br />
        &#8216; this is my own sub &#8211; positions activecell at top of my &#8220;products&#8221; column<br />
        Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select<br />
        &#8216; this extends to end of sheet &#8211; where my data area ends</p>
<p>        Selection.AutoFilter<br />
    Else<br />
        &#8216; MsgBox &#8220;Filter mode is off&#8221;</p>
<p>        Selection.AutoFilter<br />
    End If</p>
<p>End Sub</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/11/22/advanced-filtering-in-vba/#comment-47647</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Mon, 05 Jul 2010 16:03:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=875#comment-47647</guid>
		<description>&lt;p&gt;Hi all, &lt;/p&gt;
&lt;p&gt;I was wondering if someone could help with some VBA. &lt;/p&gt;
&lt;p&gt;I have a list of information that I would like to filter with multiple criteria in one column.  So, for example column B would contain numbers and I want to filter it to display just those rows who&#039;s values are, say, 10, 20 and 30. &lt;/p&gt;
&lt;p&gt;I have the criteria, currently, initialised as an array within the VBA code; the values do not exist on the spreadsheet so I can&#039;t reference a Range on the sheet.  I&#039;ve spent a bit of time tinkering around with various bits, but have had no success at the moment! &lt;/p&gt;
&lt;p&gt;Any pointers would be gratefully received, &lt;/p&gt;
&lt;p&gt;Thanks in advance ... &lt;/p&gt;
&lt;p&gt;Steve.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hi all, </p>
<p>I was wondering if someone could help with some VBA. </p>
<p>I have a list of information that I would like to filter with multiple criteria in one column.  So, for example column B would contain numbers and I want to filter it to display just those rows who&#8217;s values are, say, 10, 20 and 30. </p>
<p>I have the criteria, currently, initialised as an array within the VBA code; the values do not exist on the spreadsheet so I can&#8217;t reference a Range on the sheet.  I&#8217;ve spent a bit of time tinkering around with various bits, but have had no success at the moment! </p>
<p>Any pointers would be gratefully received, </p>
<p>Thanks in advance &#8230; </p>
<p>Steve.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Manju</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/11/22/advanced-filtering-in-vba/#comment-46747</link>
		<dc:creator>Manju</dc:creator>
		<pubDate>Thu, 10 Jun 2010 10:58:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=875#comment-46747</guid>
		<description>&lt;p&gt;Can I please get a code for : &lt;/p&gt;
&lt;p&gt;I need a filter function, the inputs for the filter are in three combo boxes. The filtered results should open in a seperate window.&lt;/p&gt;
&lt;p&gt;Please help&lt;br&gt;
Manju&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Can I please get a code for : </p>
<p>I need a filter function, the inputs for the filter are in three combo boxes. The filtered results should open in a seperate window.</p>
<p>Please help<br />
Manju</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: anon</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/11/22/advanced-filtering-in-vba/#comment-45844</link>
		<dc:creator>anon</dc:creator>
		<pubDate>Wed, 05 May 2010 02:06:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=875#comment-45844</guid>
		<description>&lt;p&gt;&quot;When I paste code into Wordpress, it converts my double quotes into something else.&quot;&lt;/p&gt;
&lt;p&gt;Please add that to the top.  Code was simple enough and didn&#039;t occur to me to double check the copy/paste.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>&#8220;When I paste code into WordPress, it converts my double quotes into something else.&#8221;</p>
<p>Please add that to the top.  Code was simple enough and didn&#8217;t occur to me to double check the copy/paste.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

