<?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: Borders on Single Columns or Single Rows</title>
	<atom:link href="http://www.dailydoseofexcel.com/archives/2009/10/28/borders-on-single-columns-or-single-rows/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dailydoseofexcel.com/archives/2009/10/28/borders-on-single-columns-or-single-rows/</link>
	<description>Daily posts of Excel tips…and other stuff</description>
	<lastBuildDate>Thu, 09 Feb 2012 23:42:03 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Excel Training</title>
		<link>http://www.dailydoseofexcel.com/archives/2009/10/28/borders-on-single-columns-or-single-rows/#comment-41965</link>
		<dc:creator>Excel Training</dc:creator>
		<pubDate>Tue, 03 Nov 2009 21:26:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=3151#comment-41965</guid>
		<description>&lt;p&gt;Thanks for all of the great/clean code.  I seem to recall this not being required in Excel 5, when changing the background color - borders remained.&lt;br&gt;
Billy Gee&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Thanks for all of the great/clean code.  I seem to recall this not being required in Excel 5, when changing the background color &#8211; borders remained.<br />
Billy Gee</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rick Rothstein (MVP - Excel)</title>
		<link>http://www.dailydoseofexcel.com/archives/2009/10/28/borders-on-single-columns-or-single-rows/#comment-41926</link>
		<dc:creator>Rick Rothstein (MVP - Excel)</dc:creator>
		<pubDate>Sun, 01 Nov 2009 17:45:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=3151#comment-41926</guid>
		<description>&lt;p&gt;Very good Sam, you are right... the BorderAround property does not have to be set... setting just the Borders property takes care of those borders as well.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Very good Sam, you are right&#8230; the BorderAround property does not have to be set&#8230; setting just the Borders property takes care of those borders as well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sam</title>
		<link>http://www.dailydoseofexcel.com/archives/2009/10/28/borders-on-single-columns-or-single-rows/#comment-41922</link>
		<dc:creator>sam</dc:creator>
		<pubDate>Sun, 01 Nov 2009 06:58:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=3151#comment-41922</guid>
		<description>&lt;p&gt;For Automatic color borders&lt;/p&gt;
&lt;p&gt;Sub AllBorders()&lt;br&gt;
Selection.Borders.LineStyle = xlContinuous&lt;br&gt;
End Sub&lt;/p&gt;
&lt;p&gt;For Color borders&lt;/p&gt;
&lt;p&gt;Sub AllBorders()&lt;br&gt;
With Selection.Borders&lt;br&gt;
.LineStyle = xlContinuous&lt;br&gt;
.Color = RGB(192, 192, 192)&lt;br&gt;
End With&lt;br&gt;
End Sub&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>For Automatic color borders</p>
<p>Sub AllBorders()<br />
Selection.Borders.LineStyle = xlContinuous<br />
End Sub</p>
<p>For Color borders</p>
<p>Sub AllBorders()<br />
With Selection.Borders<br />
.LineStyle = xlContinuous<br />
.Color = RGB(192, 192, 192)<br />
End With<br />
End Sub</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rick Rothstein (MVP - Excel)</title>
		<link>http://www.dailydoseofexcel.com/archives/2009/10/28/borders-on-single-columns-or-single-rows/#comment-41919</link>
		<dc:creator>Rick Rothstein (MVP - Excel)</dc:creator>
		<pubDate>Sat, 31 Oct 2009 19:54:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=3151#comment-41919</guid>
		<description>&lt;p&gt;Sorry, I forgot about the&lt;/p&gt;
&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;&#160;&lt;span class=&quot;kw1&quot;&gt;and&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;tags...&lt;/p&gt;
&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; cmdGridlines_Click()&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;With&lt;/span&gt; Selection&lt;br&gt;
&#160; &#160; &#160; &#160; .BorderAround xlContinuous, xlThin, , RGB(192, 192, 192)&lt;br&gt;
&#160; &#160; &#160; &#160; &lt;span class=&quot;kw1&quot;&gt;With&lt;/span&gt; .Borders&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; .LineStyle = xlContinuous&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; .Weight = xlThin&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; .Color = RGB(192, 192, 192)&lt;br&gt;
&#160; &#160; &#160; &#160; &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;With&lt;/span&gt;&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;With&lt;/span&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[<p>Sorry, I forgot about the</p>
<div style="overflow: auto; white-space: nowrap;" class="codecolorer-container vb default">
<div style="white-space: nowrap;" class="vb codecolorer">&nbsp;<span class="kw1">and</span></div>
</div>
<p>tags&#8230;</p>
<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> cmdGridlines_Click()<br />
&nbsp; &nbsp; <span class="kw1">With</span> Selection<br />
&nbsp; &nbsp; &nbsp; &nbsp; .BorderAround xlContinuous, xlThin, , RGB(192, 192, 192)<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">With</span> .Borders<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .LineStyle = xlContinuous<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .Weight = xlThin<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .Color = RGB(192, 192, 192)<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">End</span> <span class="kw1">With</span><br />
&nbsp; &nbsp; <span class="kw1">End</span> <span class="kw1">With</span><br />
<span class="kw1">End</span> <span class="kw1">Sub</span></div>
</div>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rick Rothstein (MVP - Excel)</title>
		<link>http://www.dailydoseofexcel.com/archives/2009/10/28/borders-on-single-columns-or-single-rows/#comment-41918</link>
		<dc:creator>Rick Rothstein (MVP - Excel)</dc:creator>
		<pubDate>Sat, 31 Oct 2009 19:52:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=3151#comment-41918</guid>
		<description>&lt;p&gt;What about this simpler code that seems to work for all selection situations...&lt;/p&gt;
&lt;p&gt;Sub cmdGridlines_Click()&lt;br&gt;
    With Selection&lt;br&gt;
        .BorderAround xlContinuous, xlThin, , RGB(192, 192, 192)&lt;br&gt;
        With .Borders&lt;br&gt;
            .LineStyle = xlContinuous&lt;br&gt;
            .Weight = xlThin&lt;br&gt;
            .Color = RGB(192, 192, 192)&lt;br&gt;
        End With&lt;br&gt;
    End With&lt;br&gt;
End Sub&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>What about this simpler code that seems to work for all selection situations&#8230;</p>
<p>Sub cmdGridlines_Click()<br />
    With Selection<br />
        .BorderAround xlContinuous, xlThin, , RGB(192, 192, 192)<br />
        With .Borders<br />
            .LineStyle = xlContinuous<br />
            .Weight = xlThin<br />
            .Color = RGB(192, 192, 192)<br />
        End With<br />
    End With<br />
End Sub</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jan Karel Pieterse</title>
		<link>http://www.dailydoseofexcel.com/archives/2009/10/28/borders-on-single-columns-or-single-rows/#comment-41915</link>
		<dc:creator>Jan Karel Pieterse</dc:creator>
		<pubDate>Sat, 31 Oct 2009 10:40:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=3151#comment-41915</guid>
		<description>&lt;p&gt;Dick: You could also create a style with this coloring set up and just apply the style to the range.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Dick: You could also create a style with this coloring set up and just apply the style to the range.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jim Cone</title>
		<link>http://www.dailydoseofexcel.com/archives/2009/10/28/borders-on-single-columns-or-single-rows/#comment-41894</link>
		<dc:creator>Jim Cone</dc:creator>
		<pubDate>Thu, 29 Oct 2009 16:03:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=3151#comment-41894</guid>
		<description>&lt;p&gt;Years back, the Visual Basic Programmers Journal (VBPJ), in an April 1st edition editorial, stated that the next version of VB would have a Global &quot;On Error Resume Next&quot; statement included in the language.&lt;/p&gt;
&lt;p&gt;Maybe, Microsoft should have considered that option before releasing Office 2007.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Years back, the Visual Basic Programmers Journal (VBPJ), in an April 1st edition editorial, stated that the next version of VB would have a Global &#8220;On Error Resume Next&#8221; statement included in the language.</p>
<p>Maybe, Microsoft should have considered that option before releasing Office 2007.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tushar Mehta</title>
		<link>http://www.dailydoseofexcel.com/archives/2009/10/28/borders-on-single-columns-or-single-rows/#comment-41888</link>
		<dc:creator>Tushar Mehta</dc:creator>
		<pubDate>Thu, 29 Oct 2009 04:37:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=3151#comment-41888</guid>
		<description>&lt;p&gt;Dick wrote &quot;Tushar: On Error seems a little much for this particular situation. Aren&#039;t you afraid it will mask other errors?&quot;&lt;/p&gt;
&lt;p&gt;When something is the more straightforward way, it cannot possibly be &quot;a little much.&quot; {grin}&lt;/p&gt;
&lt;p&gt;Yes, masking unexpected errors is a possibility but if you set the scope of the error handler to be as narrow as possible, the risk is minimal.&lt;/p&gt;
&lt;p&gt;In the case of the chart formatting code, there was one instance where with a new version of Excel the chart did not format as expected.  It turned out Microsoft changed something so that my code was no longer valid and the error handler was masking the error.  But, it was once in...what...18...20 years or so.&lt;/p&gt;
&lt;p&gt;By contrast, if I tried to handle the options w/o an error handler, I would have to deal with present/absent primary/secondary category/value axis, legend, axis titles, chart title, horizontal/vertical gridlines, axis labels, data labels, etc., etc., etc.&lt;/p&gt;
&lt;p&gt;The error handler version of the code is a lot cleaner. And, cleaner code is easier to debug, understand, and maintain.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Dick wrote &#8220;Tushar: On Error seems a little much for this particular situation. Aren&#8217;t you afraid it will mask other errors?&#8221;</p>
<p>When something is the more straightforward way, it cannot possibly be &#8220;a little much.&#8221; {grin}</p>
<p>Yes, masking unexpected errors is a possibility but if you set the scope of the error handler to be as narrow as possible, the risk is minimal.</p>
<p>In the case of the chart formatting code, there was one instance where with a new version of Excel the chart did not format as expected.  It turned out Microsoft changed something so that my code was no longer valid and the error handler was masking the error.  But, it was once in&#8230;what&#8230;18&#8230;20 years or so.</p>
<p>By contrast, if I tried to handle the options w/o an error handler, I would have to deal with present/absent primary/secondary category/value axis, legend, axis titles, chart title, horizontal/vertical gridlines, axis labels, data labels, etc., etc., etc.</p>
<p>The error handler version of the code is a lot cleaner. And, cleaner code is easier to debug, understand, and maintain.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dick Kusleika</title>
		<link>http://www.dailydoseofexcel.com/archives/2009/10/28/borders-on-single-columns-or-single-rows/#comment-41884</link>
		<dc:creator>Dick Kusleika</dc:creator>
		<pubDate>Thu, 29 Oct 2009 01:41:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=3151#comment-41884</guid>
		<description>&lt;p&gt;JP: Quite right.  There&#039;s some insight into how this macro was written.  It started as a one-liner, but then I realized I needed more than one line, so I created the With block.  But, of course, I forgot to remove the reference from that first line.&lt;/p&gt;
&lt;p&gt;Tushar:  On Error seems a little much for this particular situation.  Aren&#039;t you afraid it will mask other errors?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>JP: Quite right.  There&#8217;s some insight into how this macro was written.  It started as a one-liner, but then I realized I needed more than one line, so I created the With block.  But, of course, I forgot to remove the reference from that first line.</p>
<p>Tushar:  On Error seems a little much for this particular situation.  Aren&#8217;t you afraid it will mask other errors?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tushar Mehta</title>
		<link>http://www.dailydoseofexcel.com/archives/2009/10/28/borders-on-single-columns-or-single-rows/#comment-41878</link>
		<dc:creator>Tushar Mehta</dc:creator>
		<pubDate>Wed, 28 Oct 2009 20:11:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=3151#comment-41878</guid>
		<description>&lt;p&gt;This is the perfect place to handle the error rather than trying to avoid it.  Do this &quot;test if a property would make sense&quot; with code to format a chart and the code would get very unwieldy. On the other hand, stick in a &#039;On Error Resume Next&#039; at the top and let the code run. Properties that don&#039;t apply to a particular chart will be gracefully skipped w/o any fancy or overly complicated tests.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>This is the perfect place to handle the error rather than trying to avoid it.  Do this &#8220;test if a property would make sense&#8221; with code to format a chart and the code would get very unwieldy. On the other hand, stick in a &#8216;On Error Resume Next&#8217; at the top and let the code run. Properties that don&#8217;t apply to a particular chart will be gracefully skipped w/o any fancy or overly complicated tests.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

