<?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: Two new range functions: Union and Subtract</title>
	<atom:link href="http://www.dailydoseofexcel.com/archives/2007/08/17/two-new-range-functions-union-and-subtract/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dailydoseofexcel.com/archives/2007/08/17/two-new-range-functions-union-and-subtract/</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: Rich Sulin</title>
		<link>http://www.dailydoseofexcel.com/archives/2007/08/17/two-new-range-functions-union-and-subtract/#comment-66075</link>
		<dc:creator>Rich Sulin</dc:creator>
		<pubDate>Sat, 03 Sep 2011 21:51:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1714#comment-66075</guid>
		<description>&lt;p&gt;(Webmaster, please delete my previous post)&lt;br&gt;
Thanks Tushar, Rick and Dick, I will try these other ideas when I get a chance. For the sake of others who might be reading this thread, here is what I originally did:&lt;/p&gt;
&lt;p&gt;Calling program:&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;Public&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; vCopyAndPasteWithExceptions_Go()&lt;br&gt;
&#160;Load CopyAndPasteWithExceptions&lt;br&gt;
&#160;CopyAndPasteWithExceptions.Show&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;
&lt;p&gt;User form code:&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;Private&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; Execute_Click()&lt;br&gt;
&#160;&#039;User form: CopyAndPasteWithExceptions&lt;br&gt;
&#160;&#039;Form has range-entry controls that provide SourceRange, TargetRange, SkipList, &lt;span class=&quot;kw1&quot;&gt;and&lt;/span&gt; &lt;br&gt;
&#160;&lt;span class=&quot;co1&quot;&gt;&#039;a checkbox for CheckBox1 (Include formatting?)&lt;br&gt;
&lt;/span&gt; &#039;&lt;br&gt;
&#160;&#039;User clicked &lt;span class=&quot;kw1&quot;&gt;on&lt;/span&gt; &quot;Execute&quot; button....&lt;br&gt;
&#160;vCopyPasteWithExceptions Me.SourceRange, Me.TargetRange, Me.SkipList, Me.CheckBox1&lt;br&gt;
&#160;Unload Me&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;
&lt;p&gt;Main program, called by user form:&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;Public&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; vCopyPasteWithExceptions(SourceRange &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;String&lt;/span&gt;, TargetRange &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;String&lt;/span&gt;, _&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; SkipList &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;String&lt;/span&gt;, IncludeFormating &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Boolean&lt;/span&gt;)&lt;br&gt;
&#160;&#039; Called by User form: CopyAndPasteWithExceptions&lt;br&gt;
&#160;&#039; v1 Rich Sulin 08-15-2011&lt;br&gt;
&lt;br&gt;
&#160;&lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; i &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;, n &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;&lt;br&gt;
&#160;&lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; oSource &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Object&lt;/span&gt;&lt;br&gt;
&#160;&lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; oTarget &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Object&lt;/span&gt;&lt;br&gt;
&#160;&lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; oExcept &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Object&lt;/span&gt;&lt;br&gt;
&#160;&lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; oTemp &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Object&lt;/span&gt;&lt;br&gt;
&lt;br&gt;
&#160;&lt;span class=&quot;kw1&quot;&gt;Set&lt;/span&gt; oSource = Range(SourceRange)&lt;br&gt;
&#160;&lt;span class=&quot;kw1&quot;&gt;Set&lt;/span&gt; oTarget = Range(TargetRange)&lt;br&gt;
&#160;&lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt; SkipList &quot;&quot; &lt;span class=&quot;kw1&quot;&gt;Then&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Set&lt;/span&gt; oExcept = Range(SkipList)&lt;br&gt;
&lt;br&gt;
&#160;n = oSource.Cells.Count&lt;br&gt;
&#160;Application.ScreenUpdating = &lt;span class=&quot;kw1&quot;&gt;False&lt;/span&gt; &#039;speed up process, turn off screen updates&lt;br&gt;
&lt;br&gt;
&#160;&#039;Copy the formulas&lt;br&gt;
&#160;&lt;span class=&quot;kw1&quot;&gt;For&lt;/span&gt; i = 1 &lt;span class=&quot;kw1&quot;&gt;To&lt;/span&gt; n&lt;br&gt;
&#160; &#160;&lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt; SkipList &quot;&quot; &lt;span class=&quot;kw1&quot;&gt;Then&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Set&lt;/span&gt; oTemp = Application.Intersect(oTarget(i), oExcept)&lt;br&gt;
&#160; &#160;&lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt; oTemp &lt;span class=&quot;kw1&quot;&gt;Is&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Nothing&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Then&lt;/span&gt;&lt;br&gt;
&#160; &#160; &#160; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt; IncludeFormating &lt;span class=&quot;kw1&quot;&gt;Then&lt;/span&gt;&lt;br&gt;
&#160; &#160; &#160; &#160; &#160;oSource(i).Copy oTarget(i)&lt;br&gt;
&#160; &#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Else&lt;/span&gt;&lt;br&gt;
&#160; &#160; &#160; &#160; &#160;oSource(i).Copy&lt;br&gt;
&#160; &#160; &#160; &#160; &#160;oTarget(i).PasteSpecial xlPasteFormulas&lt;br&gt;
&#160; &#160; &#160; &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;
&#160; &#160;&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;
&#160;Application.StatusBar = &quot;Done: &quot; &amp; Format(i / n, &quot;##0%&quot;) &#039;progress, visual feedback&lt;br&gt;
&lt;br&gt;
&#160;&lt;span class=&quot;kw1&quot;&gt;Next&lt;/span&gt; i&lt;br&gt;
&lt;br&gt;
&#160;Application.ScreenUpdating = &lt;span class=&quot;kw1&quot;&gt;True&lt;/span&gt;&lt;br&gt;
&#160;Application.StatusBar = &lt;span class=&quot;kw1&quot;&gt;False&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>(Webmaster, please delete my previous post)<br />
Thanks Tushar, Rick and Dick, I will try these other ideas when I get a chance. For the sake of others who might be reading this thread, here is what I originally did:</p>
<p>Calling program:</p>
<div style="overflow: auto; white-space: nowrap;" class="codecolorer-container vb default">
<div style="white-space: nowrap;" class="vb codecolorer"><span class="kw1">Public</span> <span class="kw1">Sub</span> vCopyAndPasteWithExceptions_Go()<br />
&nbsp;Load CopyAndPasteWithExceptions<br />
&nbsp;CopyAndPasteWithExceptions.Show<br />
<span class="kw1">End</span> <span class="kw1">Sub</span></div>
</div>
<p>User form code:</p>
<div style="overflow: auto; white-space: nowrap;" class="codecolorer-container vb default">
<div style="white-space: nowrap;" class="vb codecolorer"><span class="kw1">Private</span> <span class="kw1">Sub</span> Execute_Click()<br />
&nbsp;&#8217;User form: CopyAndPasteWithExceptions<br />
&nbsp;&#8217;Form has range-entry controls that provide SourceRange, TargetRange, SkipList, <span class="kw1">and</span> <br />
&nbsp;<span class="co1">&#8216;a checkbox for CheckBox1 (Include formatting?)<br />
</span> &#8216;<br />
&nbsp;&#8217;User clicked <span class="kw1">on</span> &#8220;Execute&#8221; button&#8230;.<br />
&nbsp;vCopyPasteWithExceptions Me.SourceRange, Me.TargetRange, Me.SkipList, Me.CheckBox1<br />
&nbsp;Unload Me<br />
<span class="kw1">End</span> <span class="kw1">Sub</span></div>
</div>
<p>Main program, called by user form:</p>
<div style="overflow: auto; white-space: nowrap;" class="codecolorer-container vb default">
<div style="white-space: nowrap;" class="vb codecolorer"><span class="kw1">Public</span> <span class="kw1">Sub</span> vCopyPasteWithExceptions(SourceRange <span class="kw1">As</span> <span class="kw1">String</span>, TargetRange <span class="kw1">As</span> <span class="kw1">String</span>, _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SkipList <span class="kw1">As</span> <span class="kw1">String</span>, IncludeFormating <span class="kw1">As</span> <span class="kw1">Boolean</span>)<br />
&nbsp;&#8217; Called by User form: CopyAndPasteWithExceptions<br />
&nbsp;&#8217; v1 Rich Sulin 08-15-2011</p>
<p>&nbsp;<span class="kw1">Dim</span> i <span class="kw1">As</span> <span class="kw1">Long</span>, n <span class="kw1">As</span> <span class="kw1">Long</span><br />
&nbsp;<span class="kw1">Dim</span> oSource <span class="kw1">As</span> <span class="kw1">Object</span><br />
&nbsp;<span class="kw1">Dim</span> oTarget <span class="kw1">As</span> <span class="kw1">Object</span><br />
&nbsp;<span class="kw1">Dim</span> oExcept <span class="kw1">As</span> <span class="kw1">Object</span><br />
&nbsp;<span class="kw1">Dim</span> oTemp <span class="kw1">As</span> <span class="kw1">Object</span></p>
<p>&nbsp;<span class="kw1">Set</span> oSource = Range(SourceRange)<br />
&nbsp;<span class="kw1">Set</span> oTarget = Range(TargetRange)<br />
&nbsp;<span class="kw1">If</span> SkipList &#8220;&#8221; <span class="kw1">Then</span> <span class="kw1">Set</span> oExcept = Range(SkipList)</p>
<p>&nbsp;n = oSource.Cells.Count<br />
&nbsp;Application.ScreenUpdating = <span class="kw1">False</span> &#8216;speed up process, turn off screen updates</p>
<p>&nbsp;&#8217;Copy the formulas<br />
&nbsp;<span class="kw1">For</span> i = 1 <span class="kw1">To</span> n<br />
&nbsp; &nbsp;<span class="kw1">If</span> SkipList &#8220;&#8221; <span class="kw1">Then</span> <span class="kw1">Set</span> oTemp = Application.Intersect(oTarget(i), oExcept)<br />
&nbsp; &nbsp;<span class="kw1">If</span> oTemp <span class="kw1">Is</span> <span class="kw1">Nothing</span> <span class="kw1">Then</span><br />
&nbsp; &nbsp; &nbsp; <span class="kw1">If</span> IncludeFormating <span class="kw1">Then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oSource(i).Copy oTarget(i)<br />
&nbsp; &nbsp; &nbsp; <span class="kw1">Else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oSource(i).Copy<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oTarget(i).PasteSpecial xlPasteFormulas<br />
&nbsp; &nbsp; &nbsp; <span class="kw1">End</span> <span class="kw1">If</span><br />
&nbsp; &nbsp;<span class="kw1">End</span> <span class="kw1">If</span> </p>
<p>&nbsp;Application.StatusBar = &#8220;Done: &#8221; &amp; Format(i / n, &#8220;##0%&#8221;) &#8216;progress, visual feedback</p>
<p>&nbsp;<span class="kw1">Next</span> i</p>
<p>&nbsp;Application.ScreenUpdating = <span class="kw1">True</span><br />
&nbsp;Application.StatusBar = <span class="kw1">False</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/2007/08/17/two-new-range-functions-union-and-subtract/#comment-66038</link>
		<dc:creator>Rick Rothstein (MVP - Excel)</dc:creator>
		<pubDate>Sat, 03 Sep 2011 01:16:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1714#comment-66038</guid>
		<description>&lt;p&gt;Well duh! Of course, using the tags in my last reply created the code box rather than display the code tag&#039;s text. So much for my demo :-)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Well duh! Of course, using the tags in my last reply created the code box rather than display the code tag&#8217;s text. So much for my demo <img src='http://www.dailydoseofexcel.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rick Rothstein (MVP - Excel)</title>
		<link>http://www.dailydoseofexcel.com/archives/2007/08/17/two-new-range-functions-union-and-subtract/#comment-66037</link>
		<dc:creator>Rick Rothstein (MVP - Excel)</dc:creator>
		<pubDate>Sat, 03 Sep 2011 01:13:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1714#comment-66037</guid>
		<description>&lt;p&gt;@Rich Sulin,&lt;/p&gt;
&lt;p&gt;You need to use one of the set of code tags listed above the &quot;Leave a Reply&quot; (in blue letters) located above where your name goes when posting a reply. Namely, for your VB code...&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;Your code goes here&lt;/div&gt;&lt;/div&gt;
</description>
		<content:encoded><![CDATA[<p>@Rich Sulin,</p>
<p>You need to use one of the set of code tags listed above the &#8220;Leave a Reply&#8221; (in blue letters) located above where your name goes when posting a reply. Namely, for your VB code&#8230;</p>
<div style="overflow: auto; white-space: nowrap;" class="codecolorer-container vb default">
<div style="white-space: nowrap;" class="vb codecolorer">Your code goes here</div>
</div>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rich Sulin</title>
		<link>http://www.dailydoseofexcel.com/archives/2007/08/17/two-new-range-functions-union-and-subtract/#comment-65922</link>
		<dc:creator>Rich Sulin</dc:creator>
		<pubDate>Tue, 30 Aug 2011 19:26:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1714#comment-65922</guid>
		<description>&lt;p&gt;Strange, the less-than and greater-than characters didnt appear above. In two places it should be:&lt;br&gt;
If SkipList LT GT &quot;&quot; Then...&lt;/p&gt;
&lt;p&gt;(I had to type as letters here to get it to appear)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Strange, the less-than and greater-than characters didnt appear above. In two places it should be:<br />
If SkipList LT GT &#8220;&#8221; Then&#8230;</p>
<p>(I had to type as letters here to get it to appear)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rick Rothstein (MVP - Excel)</title>
		<link>http://www.dailydoseofexcel.com/archives/2007/08/17/two-new-range-functions-union-and-subtract/#comment-65715</link>
		<dc:creator>Rick Rothstein (MVP - Excel)</dc:creator>
		<pubDate>Sun, 21 Aug 2011 04:49:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1714#comment-65715</guid>
		<description>&lt;p&gt;@Tushar - Whoops! It looks like I went and reinvented the wheel. (°o°)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@Tushar &#8211; Whoops! It looks like I went and reinvented the wheel. (°o°)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tushar Mehta</title>
		<link>http://www.dailydoseofexcel.com/archives/2007/08/17/two-new-range-functions-union-and-subtract/#comment-65712</link>
		<dc:creator>Tushar Mehta</dc:creator>
		<pubDate>Sun, 21 Aug 2011 01:13:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1714#comment-65712</guid>
		<description>&lt;p&gt;Rick: The worksheet technique you use is the one illustrated in the SubtractUsingWS function in the original post.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Rick: The worksheet technique you use is the one illustrated in the SubtractUsingWS function in the original post.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rick Rothstein (MVP - Excel)</title>
		<link>http://www.dailydoseofexcel.com/archives/2007/08/17/two-new-range-functions-union-and-subtract/#comment-65704</link>
		<dc:creator>Rick Rothstein (MVP - Excel)</dc:creator>
		<pubDate>Sat, 20 Aug 2011 19:22:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1714#comment-65704</guid>
		<description>&lt;p&gt;@Rich Sulin,&lt;/p&gt;
&lt;p&gt;If the workbook is not protected, then you can use the subroutine below to do what you asked without visiting each cell individually. If the workbook is protected, and if you have the password, then you can add the appropriate code to the subroutine below in order to remove it, execute the code, then reestablish it. Note that this subroutine, as written, expects the source worksheet to be the active sheet when it is executed.&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; CopyWithExclusions(DestinationSheetName &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;String&lt;/span&gt;, LargeRangeCellAddress &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;String&lt;/span&gt;, _&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&lt;span class=&quot;kw1&quot;&gt;ParamArray&lt;/span&gt; ExclusionCellAddresses() &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Variant&lt;/span&gt;)&lt;br&gt;
&#160; &lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; Addr &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Variant&lt;/span&gt;, CopyRangeAddresses &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;String&lt;/span&gt;, Ar &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; Range, WS &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; Worksheet&lt;br&gt;
&#160; &lt;span class=&quot;kw1&quot;&gt;Set&lt;/span&gt; WS = ActiveSheet&lt;br&gt;
&#160; Application.ScreenUpdating = &lt;span class=&quot;kw1&quot;&gt;False&lt;/span&gt;&lt;br&gt;
&#160; &lt;span class=&quot;kw1&quot;&gt;With&lt;/span&gt; Sheets.Add&lt;br&gt;
&#160; &#160; .Range(LargeRangeCellAddress).Value = &lt;span class=&quot;st0&quot;&gt;&quot;X&quot;&lt;/span&gt;&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;For&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Each&lt;/span&gt; Addr &lt;span class=&quot;kw1&quot;&gt;In&lt;/span&gt; ExclusionCellAddresses&lt;br&gt;
&#160; &#160; &#160; .Range(Addr).Clear&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Next&lt;/span&gt;&lt;br&gt;
&#160; &#160; CopyRangeAddresses = .Cells.SpecialCells(xlCellTypeConstants).Address&lt;br&gt;
&#160; &#160; Application.DisplayAlerts = &lt;span class=&quot;kw1&quot;&gt;False&lt;/span&gt;&lt;br&gt;
&#160; &#160; .Delete&lt;br&gt;
&#160; &#160; Application.DisplayAlerts = &lt;span class=&quot;kw1&quot;&gt;True&lt;/span&gt;&lt;br&gt;
&#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; &lt;span class=&quot;kw1&quot;&gt;For&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Each&lt;/span&gt; Ar &lt;span class=&quot;kw1&quot;&gt;In&lt;/span&gt; WS.Range(CopyRangeAddresses)&lt;br&gt;
&#160; &#160; Worksheets(DestinationSheet).Range(Ar.Address).Value = Ar.Value&lt;br&gt;
&#160; &lt;span class=&quot;kw1&quot;&gt;Next&lt;/span&gt;&lt;br&gt;
&#160; Application.ScreenUpdating = &lt;span class=&quot;kw1&quot;&gt;True&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;
&lt;p&gt;A sample call to this subroutine might look like this (assumed to be run from any sheet other than Sheet2)...&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; Test()&lt;br&gt;
&#160; CopyWithExclusions &lt;span class=&quot;st0&quot;&gt;&quot;Sheet2&quot;&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&quot;B3:M28&quot;&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&quot;D4:F6&quot;&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&quot;F17:F22&quot;&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&quot;I8:K8&quot;&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&quot;L21:M25&quot;&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;
&lt;p&gt;Note that this same concept (insert a sheet, fill/clear ranges as required) can be used to create (non-UDF) functions to return &quot;pure&quot; unions and &quot;pure&quot; non-interesected ranges. Doing it this way would overcome the slowness of performing multiple unions and also eliminate the double counting of cells the result from &quot;unioning&quot; ranges that overlap. Anyway, it&#039;s just an idea.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@Rich Sulin,</p>
<p>If the workbook is not protected, then you can use the subroutine below to do what you asked without visiting each cell individually. If the workbook is protected, and if you have the password, then you can add the appropriate code to the subroutine below in order to remove it, execute the code, then reestablish it. Note that this subroutine, as written, expects the source worksheet to be the active sheet when it is executed.</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> CopyWithExclusions(DestinationSheetName <span class="kw1">As</span> <span class="kw1">String</span>, LargeRangeCellAddress <span class="kw1">As</span> <span class="kw1">String</span>, _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">ParamArray</span> ExclusionCellAddresses() <span class="kw1">As</span> <span class="kw1">Variant</span>)<br />
&nbsp; <span class="kw1">Dim</span> Addr <span class="kw1">As</span> <span class="kw1">Variant</span>, CopyRangeAddresses <span class="kw1">As</span> <span class="kw1">String</span>, Ar <span class="kw1">As</span> Range, WS <span class="kw1">As</span> Worksheet<br />
&nbsp; <span class="kw1">Set</span> WS = ActiveSheet<br />
&nbsp; Application.ScreenUpdating = <span class="kw1">False</span><br />
&nbsp; <span class="kw1">With</span> Sheets.Add<br />
&nbsp; &nbsp; .Range(LargeRangeCellAddress).Value = <span class="st0">&#8220;X&#8221;</span><br />
&nbsp; &nbsp; <span class="kw1">For</span> <span class="kw1">Each</span> Addr <span class="kw1">In</span> ExclusionCellAddresses<br />
&nbsp; &nbsp; &nbsp; .Range(Addr).Clear<br />
&nbsp; &nbsp; <span class="kw1">Next</span><br />
&nbsp; &nbsp; CopyRangeAddresses = .Cells.SpecialCells(xlCellTypeConstants).Address<br />
&nbsp; &nbsp; Application.DisplayAlerts = <span class="kw1">False</span><br />
&nbsp; &nbsp; .Delete<br />
&nbsp; &nbsp; Application.DisplayAlerts = <span class="kw1">True</span><br />
&nbsp; <span class="kw1">End</span> <span class="kw1">With</span><br />
&nbsp; <span class="kw1">For</span> <span class="kw1">Each</span> Ar <span class="kw1">In</span> WS.Range(CopyRangeAddresses)<br />
&nbsp; &nbsp; Worksheets(DestinationSheet).Range(Ar.Address).Value = Ar.Value<br />
&nbsp; <span class="kw1">Next</span><br />
&nbsp; Application.ScreenUpdating = <span class="kw1">True</span><br />
<span class="kw1">End</span> <span class="kw1">Sub</span></div>
</div>
<p>A sample call to this subroutine might look like this (assumed to be run from any sheet other than Sheet2)&#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> Test()<br />
&nbsp; CopyWithExclusions <span class="st0">&#8220;Sheet2&#8243;</span>, <span class="st0">&#8220;B3:M28&#8243;</span>, <span class="st0">&#8220;D4:F6&#8243;</span>, <span class="st0">&#8220;F17:F22&#8243;</span>, <span class="st0">&#8220;I8:K8&#8243;</span>, <span class="st0">&#8220;L21:M25&#8243;</span><br />
<span class="kw1">End</span> <span class="kw1">Sub</span></div>
</div>
<p>Note that this same concept (insert a sheet, fill/clear ranges as required) can be used to create (non-UDF) functions to return &#8220;pure&#8221; unions and &#8220;pure&#8221; non-interesected ranges. Doing it this way would overcome the slowness of performing multiple unions and also eliminate the double counting of cells the result from &#8220;unioning&#8221; ranges that overlap. Anyway, it&#8217;s just an idea.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ease of reuse of modular code « TM Consulting Blog</title>
		<link>http://www.dailydoseofexcel.com/archives/2007/08/17/two-new-range-functions-union-and-subtract/#comment-65683</link>
		<dc:creator>Ease of reuse of modular code « TM Consulting Blog</dc:creator>
		<pubDate>Fri, 19 Aug 2011 17:28:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1714#comment-65683</guid>
		<description>&lt;p&gt;[...] of the comments to my post Two new range functions: Union and Subtract (www.dailydoseofexcel.com/archives/2007/08/17/two-new-range-functions-union-and-subtract/) was a request for code to copy a range from one worksheet to another with certain ranges excluded. [...]&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>[...] of the comments to my post Two new range functions: Union and Subtract (www.dailydoseofexcel.com/archives/2007/08/17/two-new-range-functions-union-and-subtract/) was a request for code to copy a range from one worksheet to another with certain ranges excluded. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tushar Mehta</title>
		<link>http://www.dailydoseofexcel.com/archives/2007/08/17/two-new-range-functions-union-and-subtract/#comment-65682</link>
		<dc:creator>Tushar Mehta</dc:creator>
		<pubDate>Fri, 19 Aug 2011 17:21:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1714#comment-65682</guid>
		<description>&lt;p&gt;Rich: My first instinct was the same as DK&#039;s but I couldn&#039;t pass up the opportunity to illustrate the benefit of modular code.  See &lt;a href=&quot;http://www.dailydoseofexcel.com/archives/2011/08/19/ease-of-reuse-of-modular-code/&quot; rel=&quot;nofollow&quot;&gt;http://www.dailydoseofexcel.com/archives/2011/08/19/ease-of-reuse-of-modular-code/&lt;/a&gt;&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Rich: My first instinct was the same as DK&#8217;s but I couldn&#8217;t pass up the opportunity to illustrate the benefit of modular code.  See <a href="http://www.dailydoseofexcel.com/archives/2011/08/19/ease-of-reuse-of-modular-code/" rel="nofollow">http://www.dailydoseofexcel.com/archives/2011/08/19/ease-of-reuse-of-modular-code/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dick Kusleika</title>
		<link>http://www.dailydoseofexcel.com/archives/2007/08/17/two-new-range-functions-union-and-subtract/#comment-65653</link>
		<dc:creator>Dick Kusleika</dc:creator>
		<pubDate>Thu, 18 Aug 2011 17:59:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1714#comment-65653</guid>
		<description>&lt;p&gt;Rich: I can&#039;t think of a better way than cell-by-cell.  You could try to identify larger chunks, but for twice a month it&#039;s probably not worth it.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Rich: I can&#8217;t think of a better way than cell-by-cell.  You could try to identify larger chunks, but for twice a month it&#8217;s probably not worth it.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

