<?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: VBA to Filter Chart Data Range</title>
	<atom:link href="http://peltiertech.com/WordPress/vba-to-filter-chart-data-range/feed/" rel="self" type="application/rss+xml" />
	<link>http://peltiertech.com/WordPress/vba-to-filter-chart-data-range/</link>
	<description>Peltier Tech Excel Charts and Programming Blog</description>
	<lastBuildDate>Thu, 11 Mar 2010 22:03:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: Jon Peltier</title>
		<link>http://peltiertech.com/WordPress/vba-to-filter-chart-data-range/comment-page-1/#comment-17492</link>
		<dc:creator>Jon Peltier</dc:creator>
		<pubDate>Sun, 09 Aug 2009 13:45:29 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=1147#comment-17492</guid>
		<description>Kapil -

That&#039;s a broad topic which I&#039;ve covered in many posts and web pages. I recommend searching the site for &quot;scrollbar&quot; or &quot;scroll bar&quot;.</description>
		<content:encoded><![CDATA[<p>Kapil -</p>
<p>That&#8217;s a broad topic which I&#8217;ve covered in many posts and web pages. I recommend searching the site for &#8220;scrollbar&#8221; or &#8220;scroll bar&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kapil bhardwaj</title>
		<link>http://peltiertech.com/WordPress/vba-to-filter-chart-data-range/comment-page-1/#comment-17484</link>
		<dc:creator>Kapil bhardwaj</dc:creator>
		<pubDate>Sun, 09 Aug 2009 08:39:44 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=1147#comment-17484</guid>
		<description>hello sir,

I have seen your code for making a chart for filter data..

Now I want to use a scroll bar in this logic itself. can you guide me how to do that.</description>
		<content:encoded><![CDATA[<p>hello sir,</p>
<p>I have seen your code for making a chart for filter data..</p>
<p>Now I want to use a scroll bar in this logic itself. can you guide me how to do that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Peltier</title>
		<link>http://peltiertech.com/WordPress/vba-to-filter-chart-data-range/comment-page-1/#comment-10373</link>
		<dc:creator>Jon Peltier</dc:creator>
		<pubDate>Sun, 15 Feb 2009 14:41:17 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=1147#comment-10373</guid>
		<description>You got confused with the textbox labeling and the index j and so forth, but here is a more detailed approach.

In each TextBox change event procedures you should call a separate sorting routine, and pass information about the textbox control to the routine.

&lt;pre class=&quot;vbasmall&quot;&gt;Private Sub FilterList(iCtrl As Long, sText As String)
    Dim iRow As Long
    Dim sCrit As String
   
    &#039;Add asterisks around text for all matches
    &#039;UCase is used to make filter case-insensitive
    sCrit = &quot;*&quot; &amp; UCase(sText) &amp; &quot;*&quot;
   
    With Me.lbxCustomers
        &#039;Start with a fresh list
        .List = vaCustNames
        &#039;Loop through the list backward - always a good
        &#039;idea when you&#039;re deleting stuff
        For iRow = .ListCount - 1 To 0 Step -1
            &#039;Remove the line if it doesn&#039;t match
            &#039;UCase used again here
            If Not UCase(.List(iRow, iCtrl)) Like sCrit Then
                .RemoveItem iRow
            End If
        Next iRow
    End With
End Sub&lt;/pre&gt;

Here is what the event procedure would look like this:

&lt;pre class=&quot;vbasmall&quot;&gt;Private Sub TextBox1_Change()
    FilterList 1, Me.TextBox1.Text
End Sub&lt;/pre&gt;

Your textboxes should be labeled starting with 0 (not 1) so that the textbox numbering matches the column numbering in the listbox, which is 0-based.</description>
		<content:encoded><![CDATA[<p>You got confused with the textbox labeling and the index j and so forth, but here is a more detailed approach.</p>
<p>In each TextBox change event procedures you should call a separate sorting routine, and pass information about the textbox control to the routine.</p>
<pre class="vbasmall">Private Sub FilterList(iCtrl As Long, sText As String)
    Dim iRow As Long
    Dim sCrit As String

    'Add asterisks around text for all matches
    'UCase is used to make filter case-insensitive
    sCrit = "*" &#038; UCase(sText) &#038; "*"

    With Me.lbxCustomers
        'Start with a fresh list
        .List = vaCustNames
        'Loop through the list backward - always a good
        'idea when you're deleting stuff
        For iRow = .ListCount - 1 To 0 Step -1
            'Remove the line if it doesn't match
            'UCase used again here
            If Not UCase(.List(iRow, iCtrl)) Like sCrit Then
                .RemoveItem iRow
            End If
        Next iRow
    End With
End Sub</pre>
<p>Here is what the event procedure would look like this:</p>
<pre class="vbasmall">Private Sub TextBox1_Change()
    FilterList 1, Me.TextBox1.Text
End Sub</pre>
<p>Your textboxes should be labeled starting with 0 (not 1) so that the textbox numbering matches the column numbering in the listbox, which is 0-based.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gustavo</title>
		<link>http://peltiertech.com/WordPress/vba-to-filter-chart-data-range/comment-page-1/#comment-10367</link>
		<dc:creator>Gustavo</dc:creator>
		<pubDate>Sun, 15 Feb 2009 12:29:24 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=1147#comment-10367</guid>
		<description>Something like this i tried but it dont work.... any idea???



Private Sub TextBox1_Change()
    
    Dim i As Long
    Dim sCrit As String

    &#039;UCase is used to make filter case-insensitive
    sCrit = &quot;*&quot; &amp; UCase(Me.Controls(&quot;TextBox1&quot; &amp; j).Text) &amp; &quot;*&quot;
        With Me.ListBox1
     filfin = Range(&quot;A65536&quot;).End(xlUp).Row
    .List = Range(&quot;A2:C&quot; &amp; filfin).Value
            For i = .ListCount - 1 To 0 Step -1
        If Not UCase(.List(i), j) Like sCrit Then
                        .RemoveItem i
            End If
        Next i
    End With
    
End Sub</description>
		<content:encoded><![CDATA[<p>Something like this i tried but it dont work&#8230;. any idea???</p>
<p>Private Sub TextBox1_Change()</p>
<p>    Dim i As Long<br />
    Dim sCrit As String</p>
<p>    &#8216;UCase is used to make filter case-insensitive<br />
    sCrit = &#8220;*&#8221; &amp; UCase(Me.Controls(&#8220;TextBox1&#8243; &amp; j).Text) &amp; &#8220;*&#8221;<br />
        With Me.ListBox1<br />
     filfin = Range(&#8220;A65536&#8243;).End(xlUp).Row<br />
    .List = Range(&#8220;A2:C&#8221; &amp; filfin).Value<br />
            For i = .ListCount &#8211; 1 To 0 Step -1<br />
        If Not UCase(.List(i), j) Like sCrit Then<br />
                        .RemoveItem i<br />
            End If<br />
        Next i<br />
    End With</p>
<p>End Sub</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Peltier</title>
		<link>http://peltiertech.com/WordPress/vba-to-filter-chart-data-range/comment-page-1/#comment-10336</link>
		<dc:creator>Jon Peltier</dc:creator>
		<pubDate>Sun, 15 Feb 2009 03:38:44 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=1147#comment-10336</guid>
		<description>Gustavo -

Wow, that was four years ago. I don&#039;t remember writing that, nor do I remember which project I was even working on at the time.

You could adjust the code in the Daily Dose article so it compares a particular column of the listbox to the particular textbox. You would define sCrit something like this:

&lt;pre class=&quot;vbasmall&quot;&gt;sCrit = &quot;*&quot; &amp; UCase(Me.controls(&quot;tbxFind&quot; &amp; j).Text) &amp; &quot;*&quot;&lt;/pre&gt;

then you test the particular item:

&lt;pre class=&quot;vbasmall&quot;&gt;If Not UCase(.List(i), j) Like sCrit Then&lt;/pre&gt;
&#160;</description>
		<content:encoded><![CDATA[<p>Gustavo -</p>
<p>Wow, that was four years ago. I don&#8217;t remember writing that, nor do I remember which project I was even working on at the time.</p>
<p>You could adjust the code in the Daily Dose article so it compares a particular column of the listbox to the particular textbox. You would define sCrit something like this:</p>
<pre class="vbasmall">sCrit = "*" &#038; UCase(Me.controls("tbxFind" &#038; j).Text) &#038; "*"</pre>
<p>then you test the particular item:</p>
<pre class="vbasmall">If Not UCase(.List(i), j) Like sCrit Then</pre>
<p>&nbsp;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gustavo</title>
		<link>http://peltiertech.com/WordPress/vba-to-filter-chart-data-range/comment-page-1/#comment-10327</link>
		<dc:creator>Gustavo</dc:creator>
		<pubDate>Sun, 15 Feb 2009 01:37:50 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=1147#comment-10327</guid>
		<description>Dear Jon,

i have a big dude about a code in vba that you create, you wrote that you can filter a listbox with 6 columns and 6 textboxes please i was reading this for long time and i cant  imagine how you can do that please if you can share the code i will really appreatiate it

thanks in advance


you write this post about this what i was taking 

http://www.dicks-blog.com/archives/2005/02/16/limit-a-listbox/</description>
		<content:encoded><![CDATA[<p>Dear Jon,</p>
<p>i have a big dude about a code in vba that you create, you wrote that you can filter a listbox with 6 columns and 6 textboxes please i was reading this for long time and i cant  imagine how you can do that please if you can share the code i will really appreatiate it</p>
<p>thanks in advance</p>
<p>you write this post about this what i was taking </p>
<p><a href="http://www.dicks-blog.com/archives/2005/02/16/limit-a-listbox/" rel="nofollow">http://www.dicks-blog.com/archives/2005/02/16/limit-a-listbox/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Peltier</title>
		<link>http://peltiertech.com/WordPress/vba-to-filter-chart-data-range/comment-page-1/#comment-6560</link>
		<dc:creator>Jon Peltier</dc:creator>
		<pubDate>Fri, 05 Dec 2008 18:58:49 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=1147#comment-6560</guid>
		<description>Colin -

Thanks. I was too busy/lazy to work out the defined names, but your approach looks good.

Incidentally, the person who asked me about this figured out the problem using defined names while I was writing this post.</description>
		<content:encoded><![CDATA[<p>Colin -</p>
<p>Thanks. I was too busy/lazy to work out the defined names, but your approach looks good.</p>
<p>Incidentally, the person who asked me about this figured out the problem using defined names while I was writing this post.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Colin Banfield</title>
		<link>http://peltiertech.com/WordPress/vba-to-filter-chart-data-range/comment-page-1/#comment-6557</link>
		<dc:creator>Colin Banfield</dc:creator>
		<pubDate>Fri, 05 Dec 2008 17:18:14 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=1147#comment-6557</guid>
		<description>Hopefully, this problem is on the list of fixes for SP2.  Your particular example is unusual because normally it&#039;s the &quot;Other Items&quot; that is charted (and not the individual items that make up the &quot;Other Items&quot; group). 

Anyway, here is a list of the formula names I created:

&#039;This is the total list range (less header row)
ListRange=OFFSET(Sheet1!$A$1,1,0,COUNTA(Sheet1!$A:$A)-1,2)

&#039;This is the position of the Total row in ListRange
TotalPos=MATCH(&quot;Total Other Items&quot;,OFFSET(ListRange,0,0,,1),0)

&#039;This is first category range (before TotalPos)
CatRange1=OFFSET(ListRange,0,0,TotalPos-1,1)

&#039;This is the second category range (after TotalPos)
CatRange2=OFFSET(ListRange,TotalPos,0,ROWS(ListRange)-ROWS(CatRange1)-1,1)

&#039;This is the union of CatRange1 &amp; CatRange2
CatRange=CatRange1,CatRange2

&#039;This is first value range (before TotalPos)
ValRange1=OFFSET(ListRange,0,1,TotalPos-1,1)

&#039;This is the second value range (after TotalPos)
ValRange2=OFFSET(ListRange,TotalPos,1,ROWS(ListRange)-ROWS(CatRange1)-1,1)

&#039;This is the union of ValRange1 &amp; ValRange2
ValRange=ValRange1,ValRange2

&#039;This is the series formula
=SERIES(,Sheet1!CatRange,Sheet1!ValRange,1)

&#039;This is formula used in the Total row (column 2)
=SUM(ValRange2)</description>
		<content:encoded><![CDATA[<p>Hopefully, this problem is on the list of fixes for SP2.  Your particular example is unusual because normally it&#8217;s the &#8220;Other Items&#8221; that is charted (and not the individual items that make up the &#8220;Other Items&#8221; group). </p>
<p>Anyway, here is a list of the formula names I created:</p>
<p>&#8216;This is the total list range (less header row)<br />
ListRange=OFFSET(Sheet1!$A$1,1,0,COUNTA(Sheet1!$A:$A)-1,2)</p>
<p>&#8216;This is the position of the Total row in ListRange<br />
TotalPos=MATCH(&#8220;Total Other Items&#8221;,OFFSET(ListRange,0,0,,1),0)</p>
<p>&#8216;This is first category range (before TotalPos)<br />
CatRange1=OFFSET(ListRange,0,0,TotalPos-1,1)</p>
<p>&#8216;This is the second category range (after TotalPos)<br />
CatRange2=OFFSET(ListRange,TotalPos,0,ROWS(ListRange)-ROWS(CatRange1)-1,1)</p>
<p>&#8216;This is the union of CatRange1 &amp; CatRange2<br />
CatRange=CatRange1,CatRange2</p>
<p>&#8216;This is first value range (before TotalPos)<br />
ValRange1=OFFSET(ListRange,0,1,TotalPos-1,1)</p>
<p>&#8216;This is the second value range (after TotalPos)<br />
ValRange2=OFFSET(ListRange,TotalPos,1,ROWS(ListRange)-ROWS(CatRange1)-1,1)</p>
<p>&#8216;This is the union of ValRange1 &amp; ValRange2<br />
ValRange=ValRange1,ValRange2</p>
<p>&#8216;This is the series formula<br />
=SERIES(,Sheet1!CatRange,Sheet1!ValRange,1)</p>
<p>&#8216;This is formula used in the Total row (column 2)<br />
=SUM(ValRange2)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Peltier</title>
		<link>http://peltiertech.com/WordPress/vba-to-filter-chart-data-range/comment-page-1/#comment-6555</link>
		<dc:creator>Jon Peltier</dc:creator>
		<pubDate>Fri, 05 Dec 2008 16:10:31 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=1147#comment-6555</guid>
		<description>Excel 2007 doesn&#039;t always deal cleanly with category labels. I haven&#039;t noticed this with dynamic ranges so much as in regular ranges with a lot of data. It&#039;s like I can&#039;t convince Excel to show the labels the way I want. I have no specific example in mind, but I recall agonizing over this, and I&#039;ve answered questions in forums about this.

It also seems harder to build a dynamic range in Excel 2007 than in previous versions. You have to be careful what names you use for the ranges: if the name starts with the word &quot;chart&quot; you cannot manipulate the series formula. But some of this difficulty is using the new dialogs.</description>
		<content:encoded><![CDATA[<p>Excel 2007 doesn&#8217;t always deal cleanly with category labels. I haven&#8217;t noticed this with dynamic ranges so much as in regular ranges with a lot of data. It&#8217;s like I can&#8217;t convince Excel to show the labels the way I want. I have no specific example in mind, but I recall agonizing over this, and I&#8217;ve answered questions in forums about this.</p>
<p>It also seems harder to build a dynamic range in Excel 2007 than in previous versions. You have to be careful what names you use for the ranges: if the name starts with the word &#8220;chart&#8221; you cannot manipulate the series formula. But some of this difficulty is using the new dialogs.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Colin Banfield</title>
		<link>http://peltiertech.com/WordPress/vba-to-filter-chart-data-range/comment-page-1/#comment-6554</link>
		<dc:creator>Colin Banfield</dc:creator>
		<pubDate>Fri, 05 Dec 2008 15:46:00 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=1147#comment-6554</guid>
		<description>Hi Jon,

I created a formula based version of this example.  It works perfectly in Excel 2003 but not in Excel 2007.  

On one machine where I have Excel 2007 exclusively, the category labels don&#039;t show up at all in the chart when I have a discontinuous category range name in the series formula (however, with a static discontinuous range reference, the labels show up fine).  If I add another item at the bottom of the list, the value shows up in the chart (sans label).

On another machine, I have both Excel 2003 and Excel 2007 installed.  I opened the file I created in the Excel 2007 only machine, and the category labels appear in the chart.  However, any new item entered in the list isn&#039;t added to the chart.  Sigh!</description>
		<content:encoded><![CDATA[<p>Hi Jon,</p>
<p>I created a formula based version of this example.  It works perfectly in Excel 2003 but not in Excel 2007.  </p>
<p>On one machine where I have Excel 2007 exclusively, the category labels don&#8217;t show up at all in the chart when I have a discontinuous category range name in the series formula (however, with a static discontinuous range reference, the labels show up fine).  If I add another item at the bottom of the list, the value shows up in the chart (sans label).</p>
<p>On another machine, I have both Excel 2003 and Excel 2007 installed.  I opened the file I created in the Excel 2007 only machine, and the category labels appear in the chart.  However, any new item entered in the list isn&#8217;t added to the chart.  Sigh!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
