<?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: Writing To A Range Using VBA</title>
	<atom:link href="http://www.dailydoseofexcel.com/archives/2006/12/04/writing-to-a-range-using-vba/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dailydoseofexcel.com/archives/2006/12/04/writing-to-a-range-using-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: Marco</title>
		<link>http://www.dailydoseofexcel.com/archives/2006/12/04/writing-to-a-range-using-vba/#comment-67387</link>
		<dc:creator>Marco</dc:creator>
		<pubDate>Sat, 29 Oct 2011 12:49:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1562#comment-67387</guid>
		<description>&lt;p&gt;Thanks a lot!&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Thanks a lot!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fiaz Idris</title>
		<link>http://www.dailydoseofexcel.com/archives/2006/12/04/writing-to-a-range-using-vba/#comment-65804</link>
		<dc:creator>Fiaz Idris</dc:creator>
		<pubDate>Thu, 25 Aug 2011 04:39:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1562#comment-65804</guid>
		<description>&lt;p&gt;In Excel 2010, pasting range from vba works for upto 32,767 characters. (32,767 is the cell&#039;s character limit to hold)&lt;/p&gt;
&lt;p&gt;And, if the text is longer than 32,767 characters, say 50,000... it will paste the first 32,767 in the cell (cell limit) and continue the rest of the pasting... The paste will just work normally for all the other cells (unlike Excel 2003, where the paste breaks at this point and the rest of the cells are left BLANK).&lt;/p&gt;
&lt;p&gt;So, I would say this problem is fixed in Excel 2010.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>In Excel 2010, pasting range from vba works for upto 32,767 characters. (32,767 is the cell&#8217;s character limit to hold)</p>
<p>And, if the text is longer than 32,767 characters, say 50,000&#8230; it will paste the first 32,767 in the cell (cell limit) and continue the rest of the pasting&#8230; The paste will just work normally for all the other cells (unlike Excel 2003, where the paste breaks at this point and the rest of the cells are left BLANK).</p>
<p>So, I would say this problem is fixed in Excel 2010.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris H</title>
		<link>http://www.dailydoseofexcel.com/archives/2006/12/04/writing-to-a-range-using-vba/#comment-64835</link>
		<dc:creator>Chris H</dc:creator>
		<pubDate>Thu, 23 Jun 2011 13:56:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1562#comment-64835</guid>
		<description>&lt;p&gt;Kevin:&lt;/p&gt;
&lt;p&gt;The best website I&#039;ve found for automating Outlook is here. &lt;a href=&quot;http://www.codeforexcelandoutlook.com&quot; rel=&quot;nofollow&quot;&gt;http://www.codeforexcelandoutlook.com&lt;/a&gt;&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Kevin:</p>
<p>The best website I&#8217;ve found for automating Outlook is here. <a href="http://www.codeforexcelandoutlook.com" rel="nofollow">http://www.codeforexcelandoutlook.com</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin</title>
		<link>http://www.dailydoseofexcel.com/archives/2006/12/04/writing-to-a-range-using-vba/#comment-64813</link>
		<dc:creator>Kevin</dc:creator>
		<pubDate>Tue, 21 Jun 2011 23:13:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1562#comment-64813</guid>
		<description>&lt;p&gt;I need a macro or script that an Outlook rule can execute.   I need to Export Outlook E-mails to a particular folder as Tab delimited files.   The Export function in Outlook does exactly what I need but I need it to happen automatically whenever the user sends or receives an E-mail.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I need a macro or script that an Outlook rule can execute.   I need to Export Outlook E-mails to a particular folder as Tab delimited files.   The Export function in Outlook does exactly what I need but I need it to happen automatically whenever the user sends or receives an E-mail.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark W</title>
		<link>http://www.dailydoseofexcel.com/archives/2006/12/04/writing-to-a-range-using-vba/#comment-62591</link>
		<dc:creator>Mark W</dc:creator>
		<pubDate>Mon, 25 Apr 2011 23:06:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1562#comment-62591</guid>
		<description>&lt;p&gt;Dick,&lt;/p&gt;
&lt;p&gt;Thank you for your response.  I tried copying and pasting your code but I was not able to get it work (although I only tried a couple of times).  I was able to fix mine to work by changing the line:&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;Select&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Case&lt;/span&gt; ActiveCell.Offset(0, -2).Value&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;TO:&lt;/p&gt;
&lt;div style=&quot;overflow: auto; white-space: nowrap;&quot; class=&quot;codecolorer-container text default&quot;&gt;&lt;div style=&quot;white-space: nowrap;&quot; class=&quot;text codecolorer&quot;&gt;Cells(i, j).Offset(0,-2).Value&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
I didn&#039;t do anything with the store numbers because I actually put the # signs in before posting, I have actual numbers in my subroutine. &#160;I also changed what I am filling my array with to number values instead of strings, per your suggestion.&lt;br&gt;
&lt;br&gt;
Again, your response was very much appreciated.&lt;br&gt;
&lt;br&gt;
Mark&lt;/div&gt;&lt;/div&gt;
</description>
		<content:encoded><![CDATA[<p>Dick,</p>
<p>Thank you for your response.  I tried copying and pasting your code but I was not able to get it work (although I only tried a couple of times).  I was able to fix mine to work by changing the line:</p>
<div style="overflow: auto; white-space: nowrap;" class="codecolorer-container vb default">
<div style="white-space: nowrap;" class="vb codecolorer"><span class="kw1">Select</span> <span class="kw1">Case</span> ActiveCell.Offset(0, -2).Value</div>
</div>
<p>TO:</p>
<div style="overflow: auto; white-space: nowrap;" class="codecolorer-container text default">
<div style="white-space: nowrap;" class="text codecolorer">Cells(i, j).Offset(0,-2).Value</p>
<p>
I didn&#8217;t do anything with the store numbers because I actually put the # signs in before posting, I have actual numbers in my subroutine. &nbsp;I also changed what I am filling my array with to number values instead of strings, per your suggestion.</p>
<p>Again, your response was very much appreciated.</p>
<p>Mark</p></div>
</div>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dick Kusleika</title>
		<link>http://www.dailydoseofexcel.com/archives/2006/12/04/writing-to-a-range-using-vba/#comment-62465</link>
		<dc:creator>Dick Kusleika</dc:creator>
		<pubDate>Sat, 23 Apr 2011 17:08:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1562#comment-62465</guid>
		<description>&lt;p&gt;Mark:&lt;/p&gt;
&lt;p&gt;I think you have a couple of problems.  First, you are relying on the the Activecell, specifically the value in ActiveCell.Offset(0,-2).  But the active cell doesn&#039;t ever change in your code.  Your never finding a match so you&#039;re getting all zeros.&lt;/p&gt;
&lt;p&gt;Also, your store numbers make me think you&#039;re want to compare using Like, so that 7623231 would be true for 76####1, but you&#039;re not comparing with Like.  Even if your activecell offset returned a store, it wouldn&#039;t be a match.&lt;/p&gt;
&lt;p&gt;You dim TempArray as Double, but fill it with Strings.  Excel will convert, but if you were more explicit, it would be better.&lt;/p&gt;
&lt;p&gt;Here&#039;s how I might write that 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;Sub&lt;/span&gt; VariableIndicatorCode()&lt;br&gt;
&#160; &#160;&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; vaStore &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; &#160; &lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; lLastRow &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; &#160; &lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; rStores &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; Range&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; rCell &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; Range&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; aOutput() &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; &lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; lRow &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; &#160; &#160; &#160; &lt;br&gt;
&#160; &#160; &lt;span class=&quot;co1&quot;&gt;&#039;Put the store number masks in an array, just for brevity&lt;br&gt;
&lt;/span&gt; &#160; &#160;vaStore = Array(&lt;span class=&quot;st0&quot;&gt;&quot;76####1&quot;&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&quot;76####3&quot;&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&quot;76####5&quot;&lt;/span&gt;)&lt;br&gt;
&#160; &#160; &lt;br&gt;
&#160; &#160; &lt;span class=&quot;co1&quot;&gt;&#039;Find the range of store numbers in column J&lt;br&gt;
&lt;/span&gt; &#160; &#160;&lt;span class=&quot;kw1&quot;&gt;With&lt;/span&gt; Sheet1&lt;br&gt;
&#160; &#160; &#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Set&lt;/span&gt; rStores = .Range(&lt;span class=&quot;st0&quot;&gt;&quot;J2&quot;&lt;/span&gt;, .Cells(.Rows.Count, 10).&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt;(xlUp))&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;
&#160; &#160; &lt;br&gt;
&#160; &#160; &lt;span class=&quot;co1&quot;&gt;&#039;Make my output array the same size as the store number list&lt;br&gt;
&lt;/span&gt; &#160; &#160;&lt;span class=&quot;kw1&quot;&gt;ReDim&lt;/span&gt; aOutput(1 &lt;span class=&quot;kw1&quot;&gt;To&lt;/span&gt; rStores.Cells.Count, 1 &lt;span class=&quot;kw1&quot;&gt;To&lt;/span&gt; 1)&lt;br&gt;
&#160; &#160; &lt;br&gt;
&#160; &#160; &lt;span class=&quot;co1&quot;&gt;&#039;Loop through the store numbers&lt;br&gt;
&lt;/span&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; rCell &lt;span class=&quot;kw1&quot;&gt;In&lt;/span&gt; rStores&lt;br&gt;
&#160; &#160; &#160; &#160; lRow = lRow + 1&lt;br&gt;
&#160; &#160; &#160; &#160; &lt;span class=&quot;co1&quot;&gt;&#039;Use Like to compare the store number to the mask and populate the array&lt;br&gt;
&lt;/span&gt; &#160; &#160; &#160; &#160;&lt;span class=&quot;kw1&quot;&gt;Select&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Case&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;True&lt;/span&gt;&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Case&lt;/span&gt; rCell.Value &lt;span class=&quot;kw1&quot;&gt;Like&lt;/span&gt; vaStore(0): aOutput(lRow, 1) = &lt;span class=&quot;st0&quot;&gt;&quot;One&quot;&lt;/span&gt;&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Case&lt;/span&gt; rCell.Value &lt;span class=&quot;kw1&quot;&gt;Like&lt;/span&gt; vaStore(1): aOutput(lRow, 1) = &lt;span class=&quot;st0&quot;&gt;&quot;Two&quot;&lt;/span&gt;&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Case&lt;/span&gt; rCell.Value &lt;span class=&quot;kw1&quot;&gt;Like&lt;/span&gt; vaStore(2): aOutput(lRow, 1) = &lt;span class=&quot;st0&quot;&gt;&quot;Three&quot;&lt;/span&gt;&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;Select&lt;/span&gt;&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Next&lt;/span&gt; rCell&lt;br&gt;
&#160; &#160; &lt;br&gt;
&#160; &#160; &lt;span class=&quot;co1&quot;&gt;&#039;Write the array to a range&lt;br&gt;
&lt;/span&gt; &#160; &#160;rStores.Offset(, 2).Value = aOutput&lt;br&gt;
&#160; &#160; &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>Mark:</p>
<p>I think you have a couple of problems.  First, you are relying on the the Activecell, specifically the value in ActiveCell.Offset(0,-2).  But the active cell doesn&#8217;t ever change in your code.  Your never finding a match so you&#8217;re getting all zeros.</p>
<p>Also, your store numbers make me think you&#8217;re want to compare using Like, so that 7623231 would be true for 76####1, but you&#8217;re not comparing with Like.  Even if your activecell offset returned a store, it wouldn&#8217;t be a match.</p>
<p>You dim TempArray as Double, but fill it with Strings.  Excel will convert, but if you were more explicit, it would be better.</p>
<p>Here&#8217;s how I might write that 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">Sub</span> VariableIndicatorCode()<br />
&nbsp; &nbsp;<br />
&nbsp; &nbsp; <span class="kw1">Dim</span> vaStore <span class="kw1">As</span> <span class="kw1">Variant</span><br />
&nbsp; &nbsp; <span class="kw1">Dim</span> lLastRow <span class="kw1">As</span> <span class="kw1">Long</span><br />
&nbsp; &nbsp; <span class="kw1">Dim</span> rStores <span class="kw1">As</span> Range<br />
&nbsp; &nbsp; <span class="kw1">Dim</span> rCell <span class="kw1">As</span> Range<br />
&nbsp; &nbsp; <span class="kw1">Dim</span> aOutput() <span class="kw1">As</span> <span class="kw1">String</span><br />
&nbsp; &nbsp; <span class="kw1">Dim</span> lRow <span class="kw1">As</span> <span class="kw1">Long</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="co1">&#8216;Put the store number masks in an array, just for brevity<br />
</span> &nbsp; &nbsp;vaStore = Array(<span class="st0">&#8220;76####1&#8243;</span>, <span class="st0">&#8220;76####3&#8243;</span>, <span class="st0">&#8220;76####5&#8243;</span>)<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="co1">&#8216;Find the range of store numbers in column J<br />
</span> &nbsp; &nbsp;<span class="kw1">With</span> Sheet1<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">Set</span> rStores = .Range(<span class="st0">&#8220;J2&#8243;</span>, .Cells(.Rows.Count, 10).<span class="kw1">End</span>(xlUp))<br />
&nbsp; &nbsp; <span class="kw1">End</span> <span class="kw1">With</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="co1">&#8216;Make my output array the same size as the store number list<br />
</span> &nbsp; &nbsp;<span class="kw1">ReDim</span> aOutput(1 <span class="kw1">To</span> rStores.Cells.Count, 1 <span class="kw1">To</span> 1)<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="co1">&#8216;Loop through the store numbers<br />
</span> &nbsp; &nbsp;<span class="kw1">For</span> <span class="kw1">Each</span> rCell <span class="kw1">In</span> rStores<br />
&nbsp; &nbsp; &nbsp; &nbsp; lRow = lRow + 1<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">&#8216;Use Like to compare the store number to the mask and populate the array<br />
</span> &nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">Select</span> <span class="kw1">Case</span> <span class="kw1">True</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">Case</span> rCell.Value <span class="kw1">Like</span> vaStore(0): aOutput(lRow, 1) = <span class="st0">&#8220;One&#8221;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">Case</span> rCell.Value <span class="kw1">Like</span> vaStore(1): aOutput(lRow, 1) = <span class="st0">&#8220;Two&#8221;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">Case</span> rCell.Value <span class="kw1">Like</span> vaStore(2): aOutput(lRow, 1) = <span class="st0">&#8220;Three&#8221;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">End</span> <span class="kw1">Select</span><br />
&nbsp; &nbsp; <span class="kw1">Next</span> rCell<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="co1">&#8216;Write the array to a range<br />
</span> &nbsp; &nbsp;rStores.Offset(, 2).Value = aOutput<br />
&nbsp; &nbsp; <br />
<span class="kw1">End</span> <span class="kw1">Sub</span></div>
</div>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark W</title>
		<link>http://www.dailydoseofexcel.com/archives/2006/12/04/writing-to-a-range-using-vba/#comment-62402</link>
		<dc:creator>Mark W</dc:creator>
		<pubDate>Fri, 22 Apr 2011 17:43:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1562#comment-62402</guid>
		<description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I have tried adapting this code to a subroutine of mine that uses a select case loop.  I also only return zeros when I run my program.  I am new at vba so I don&#039;t know where to start on where I am going wrong.&lt;/p&gt;
&lt;p&gt;Here is my adaptation: (Where Column L is supposed to populate with values based on the value of column J)&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; VariableIndicatorCode()&lt;br&gt;
&#160; &#160;&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; Store1 &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;String&lt;/span&gt; * 7&lt;br&gt;
&#160; &#160; Store1 = &lt;span class=&quot;st0&quot;&gt;&quot;76####1&quot;&lt;/span&gt; &#160; &#160; &#160; &#160; &#160; &lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; Store2 &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;String&lt;/span&gt; * 7&lt;br&gt;
&#160; &#160; Store2 = &lt;span class=&quot;st0&quot;&gt;&quot;76####3&quot;&lt;/span&gt; &lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; Store3 &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;String&lt;/span&gt; * 7&lt;br&gt;
&#160; &#160; Store3 = &lt;span class=&quot;st0&quot;&gt;&quot;76####5&quot;&lt;/span&gt; &lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; LR &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; &#160; LR = Range(&lt;span class=&quot;st0&quot;&gt;&quot;B&quot;&lt;/span&gt; &amp; Rows.Count).&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt;(xlUp).Row&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; CellsDown &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;, CellsAcross &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; &#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;, j &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt; &#160; &#160;&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; TempArray() &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Double&lt;/span&gt;&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; TheRange &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; Range&lt;br&gt;
&#160; &#160;&lt;br&gt;
&#160; &#160; CellsDown = LR&lt;br&gt;
&#160; &#160; CellsAcross = 12&lt;br&gt;
&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;ReDim&lt;/span&gt; TempArray(2 &lt;span class=&quot;kw1&quot;&gt;To&lt;/span&gt; CellsDown, 12 &lt;span class=&quot;kw1&quot;&gt;To&lt;/span&gt; CellsAcross)&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Set&lt;/span&gt; TheRange = Range(Cells(2, 12), Cells(CellsDown, CellsAcross))&lt;br&gt;
&#160; &#160; &lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;For&lt;/span&gt; i = 2 &lt;span class=&quot;kw1&quot;&gt;To&lt;/span&gt; CellsDown&lt;br&gt;
&#160; &#160; &#160; &#160; &lt;span class=&quot;kw1&quot;&gt;For&lt;/span&gt; j = 12 &lt;span class=&quot;kw1&quot;&gt;To&lt;/span&gt; CellsAcross&lt;br&gt;
&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Select&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Case&lt;/span&gt; ActiveCell.Offset(0, -2).Value&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Case&lt;/span&gt; Store1: TempArray(i, j) = &lt;span class=&quot;st0&quot;&gt;&quot;1&quot;&lt;/span&gt;&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Case&lt;/span&gt; Store2: TempArray(i, j) = &lt;span class=&quot;st0&quot;&gt;&quot;2&quot;&lt;/span&gt;&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Case&lt;/span&gt; Store3: TempArray(i, j) = &lt;span class=&quot;st0&quot;&gt;&quot;3&quot;&lt;/span&gt;&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Select&lt;/span&gt;&lt;br&gt;
&lt;br&gt;
&#160; &#160; &#160; &#160; &#160;&lt;span class=&quot;kw1&quot;&gt;Next&lt;/span&gt; j &#160; &#160; &#160; &#160;&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Next&lt;/span&gt; i&lt;br&gt;
&lt;br&gt;
&#160; &#160; TheRange.Value = TempArray&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;
&lt;p&gt;Does anyone have any ideas?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Mark&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>I have tried adapting this code to a subroutine of mine that uses a select case loop.  I also only return zeros when I run my program.  I am new at vba so I don&#8217;t know where to start on where I am going wrong.</p>
<p>Here is my adaptation: (Where Column L is supposed to populate with values based on the value of column J)</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> VariableIndicatorCode()<br />
&nbsp; &nbsp;<br />
&nbsp; &nbsp; <span class="kw1">Dim</span> Store1 <span class="kw1">As</span> <span class="kw1">String</span> * 7<br />
&nbsp; &nbsp; Store1 = <span class="st0">&#8220;76####1&#8243;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="kw1">Dim</span> Store2 <span class="kw1">As</span> <span class="kw1">String</span> * 7<br />
&nbsp; &nbsp; Store2 = <span class="st0">&#8220;76####3&#8243;</span> <br />
&nbsp; &nbsp; <span class="kw1">Dim</span> Store3 <span class="kw1">As</span> <span class="kw1">String</span> * 7<br />
&nbsp; &nbsp; Store3 = <span class="st0">&#8220;76####5&#8243;</span> <br />
&nbsp; &nbsp; <span class="kw1">Dim</span> LR <span class="kw1">As</span> <span class="kw1">Long</span><br />
&nbsp; &nbsp; LR = Range(<span class="st0">&#8220;B&#8221;</span> &amp; Rows.Count).<span class="kw1">End</span>(xlUp).Row<br />
&nbsp; &nbsp; <span class="kw1">Dim</span> CellsDown <span class="kw1">As</span> <span class="kw1">Long</span>, CellsAcross <span class="kw1">As</span> <span class="kw1">Long</span><br />
&nbsp; &nbsp; <span class="kw1">Dim</span> i <span class="kw1">As</span> <span class="kw1">Long</span>, j <span class="kw1">As</span> <span class="kw1">Long</span> &nbsp; &nbsp;<br />
&nbsp; &nbsp; <span class="kw1">Dim</span> TempArray() <span class="kw1">As</span> <span class="kw1">Double</span><br />
&nbsp; &nbsp; <span class="kw1">Dim</span> TheRange <span class="kw1">As</span> Range<br />
&nbsp; &nbsp;<br />
&nbsp; &nbsp; CellsDown = LR<br />
&nbsp; &nbsp; CellsAcross = 12</p>
<p>&nbsp; &nbsp; <span class="kw1">ReDim</span> TempArray(2 <span class="kw1">To</span> CellsDown, 12 <span class="kw1">To</span> CellsAcross)<br />
&nbsp; &nbsp; <span class="kw1">Set</span> TheRange = Range(Cells(2, 12), Cells(CellsDown, CellsAcross))<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="kw1">For</span> i = 2 <span class="kw1">To</span> CellsDown<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">For</span> j = 12 <span class="kw1">To</span> CellsAcross</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">Select</span> <span class="kw1">Case</span> ActiveCell.Offset(0, -2).Value<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">Case</span> Store1: TempArray(i, j) = <span class="st0">&#8220;1&#8243;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">Case</span> Store2: TempArray(i, j) = <span class="st0">&#8220;2&#8243;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">Case</span> Store3: TempArray(i, j) = <span class="st0">&#8220;3&#8243;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">End</span> <span class="kw1">Select</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">Next</span> j &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; <span class="kw1">Next</span> i</p>
<p>&nbsp; &nbsp; TheRange.Value = TempArray</p>
<p><span class="kw1">End</span> <span class="kw1">Sub</span></div>
</div>
<p>Does anyone have any ideas?</p>
<p>Thanks,</p>
<p>Mark</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: altin çilek</title>
		<link>http://www.dailydoseofexcel.com/archives/2006/12/04/writing-to-a-range-using-vba/#comment-57823</link>
		<dc:creator>altin çilek</dc:creator>
		<pubDate>Mon, 24 Jan 2011 15:59:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1562#comment-57823</guid>
		<description>&lt;p&gt;End With &#039;alternatively for speed, the above could be written to the range in a single block &#039;(see Daily Dose of Excel   Blog Archive   Writing To A Range Using VBA) &#039;&quot;For each&quot; item in a collection is usually faster than using an index &#039;(see Optimize VBA)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>End With &#8216;alternatively for speed, the above could be written to the range in a single block &#8216;(see Daily Dose of Excel   Blog Archive   Writing To A Range Using VBA) &#8216;&#8221;For each&#8221; item in a collection is usually faster than using an index &#8216;(see Optimize VBA)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ernie Keppler</title>
		<link>http://www.dailydoseofexcel.com/archives/2006/12/04/writing-to-a-range-using-vba/#comment-57791</link>
		<dc:creator>Ernie Keppler</dc:creator>
		<pubDate>Mon, 24 Jan 2011 03:50:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1562#comment-57791</guid>
		<description>&lt;p&gt;I am writing code to take data from three different spreadsheets and add the values for each cell from B2 to K11. Then I add the columns and the rows.  This required a fairly long piece of code. I would like to write a do loop to do this, but am not sure if I need to treat the data as an array.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I am writing code to take data from three different spreadsheets and add the values for each cell from B2 to K11. Then I add the columns and the rows.  This required a fairly long piece of code. I would like to write a do loop to do this, but am not sure if I need to treat the data as an array.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gonzola</title>
		<link>http://www.dailydoseofexcel.com/archives/2006/12/04/writing-to-a-range-using-vba/#comment-54123</link>
		<dc:creator>gonzola</dc:creator>
		<pubDate>Mon, 15 Nov 2010 12:04:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1562#comment-54123</guid>
		<description>&lt;p&gt;WOW !!!!!&lt;/p&gt;
&lt;p&gt;TOTALLY AMAZING !!!!!!!!!&lt;/p&gt;
&lt;p&gt;I had 100,000 rows of data with 13 columns.&lt;/p&gt;
&lt;p&gt;I used a loop to read from an array to the cells.&lt;/p&gt;
&lt;p&gt;It took 25 minutes.&lt;/p&gt;
&lt;p&gt;I used application.screenupdating = false and it didn&#039;t make a significant difference at all.  It still took around 25 minutes, maybe a couple of minutes sooner, but not much.&lt;/p&gt;
&lt;p&gt;I used the technique you showed to move from an array to a range of cells and the total time it took was 1 second.&lt;/p&gt;
&lt;p&gt;I doubled the rows to 200,000 and the total time it took was 2 second.&lt;/p&gt;
&lt;p&gt;I no longer have to worry about whether I want to show the details or not.&lt;/p&gt;
&lt;p&gt;I show them every time.&lt;/p&gt;
&lt;p&gt;Thank you for this extremely valuable information.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>WOW !!!!!</p>
<p>TOTALLY AMAZING !!!!!!!!!</p>
<p>I had 100,000 rows of data with 13 columns.</p>
<p>I used a loop to read from an array to the cells.</p>
<p>It took 25 minutes.</p>
<p>I used application.screenupdating = false and it didn&#8217;t make a significant difference at all.  It still took around 25 minutes, maybe a couple of minutes sooner, but not much.</p>
<p>I used the technique you showed to move from an array to a range of cells and the total time it took was 1 second.</p>
<p>I doubled the rows to 200,000 and the total time it took was 2 second.</p>
<p>I no longer have to worry about whether I want to show the details or not.</p>
<p>I show them every time.</p>
<p>Thank you for this extremely valuable information.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

