<?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: Data manipulation in VBA and Excel; it&#8217;s slow, real slow</title>
	<atom:link href="http://owened.net/2008/04/02/data-manipulation-in-vba-and-excel-its-slow-real-slow/feed" rel="self" type="application/rss+xml" />
	<link>http://owened.net/2008/04/02/data-manipulation-in-vba-and-excel-its-slow-real-slow</link>
	<description>it&#039;s probably awesome</description>
	<lastBuildDate>Sat, 24 Dec 2011 23:12:36 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
	<item>
		<title>By: Cory</title>
		<link>http://owened.net/2008/04/02/data-manipulation-in-vba-and-excel-its-slow-real-slow/comment-page-1#comment-15670</link>
		<dc:creator>Cory</dc:creator>
		<pubDate>Wed, 15 Oct 2008 02:22:35 +0000</pubDate>
		<guid isPermaLink="false">http://owened.net/?p=334#comment-15670</guid>
		<description>Actually, you can copy those rows using the filter for the worksheet.  just filter that column for True, and the worksheet will only show those rows, highlight the rows, copy-&gt;paste...done</description>
		<content:encoded><![CDATA[<p>Actually, you can copy those rows using the filter for the worksheet.  just filter that column for True, and the worksheet will only show those rows, highlight the rows, copy-&gt;paste&#8230;done</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cory</title>
		<link>http://owened.net/2008/04/02/data-manipulation-in-vba-and-excel-its-slow-real-slow/comment-page-1#comment-15669</link>
		<dc:creator>Cory</dc:creator>
		<pubDate>Wed, 15 Oct 2008 02:20:20 +0000</pubDate>
		<guid isPermaLink="false">http://owened.net/?p=334#comment-15669</guid>
		<description>Just ran across this, thought I&#039;d give my two cents even though it&#039;s pretty old.

If you just need to mark which rows need copied, one way would be to use an integer array in VBA which stores the rows that need copied.  For example:

dim copyRows(1 to 100) as Integer
dim numRowsToCopy as Integer
dim rowToCopy as integer

numRowsToCopy = 0

&#039;***code to check if a row needs copied***
&#039;for this example the row is stored in rowToCopy

&#039;if a row needs copied, add 1 to the numRowsToCopy counter
numRowsToCopy = numRowsToCopy + 1

&#039;If you need to copy the row, then
&#039;Check if the array is big enough.  If not, redim it.
if numRowsToCopy &gt; UBound(copyRows) then Redim Preserve copyRows(1 to UBound(copyRows) + 100)

&#039;add the row number to your array
copyRows(numRowsToCopy) = rowToCopy

Another way would be to just use matrix multiplication via the SUMPRODUCT worksheet function and dynamic named ranges.  No VBA required.  Not sure if this would be much slower.  Basically it would do a matrix multiply and you could store the result in another column (True or False). Then use a simple copy code to move those rows.

Personally, I like the VBA because it&#039;s hidden and the end-user is less likely to mess it up.</description>
		<content:encoded><![CDATA[<p>Just ran across this, thought I&#8217;d give my two cents even though it&#8217;s pretty old.</p>
<p>If you just need to mark which rows need copied, one way would be to use an integer array in VBA which stores the rows that need copied.  For example:</p>
<p>dim copyRows(1 to 100) as Integer<br />
dim numRowsToCopy as Integer<br />
dim rowToCopy as integer</p>
<p>numRowsToCopy = 0</p>
<p>&#8216;***code to check if a row needs copied***<br />
&#8216;for this example the row is stored in rowToCopy</p>
<p>&#8216;if a row needs copied, add 1 to the numRowsToCopy counter<br />
numRowsToCopy = numRowsToCopy + 1</p>
<p>&#8216;If you need to copy the row, then<br />
&#8216;Check if the array is big enough.  If not, redim it.<br />
if numRowsToCopy &gt; UBound(copyRows) then Redim Preserve copyRows(1 to UBound(copyRows) + 100)</p>
<p>&#8216;add the row number to your array<br />
copyRows(numRowsToCopy) = rowToCopy</p>
<p>Another way would be to just use matrix multiplication via the SUMPRODUCT worksheet function and dynamic named ranges.  No VBA required.  Not sure if this would be much slower.  Basically it would do a matrix multiply and you could store the result in another column (True or False). Then use a simple copy code to move those rows.</p>
<p>Personally, I like the VBA because it&#8217;s hidden and the end-user is less likely to mess it up.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Owen</title>
		<link>http://owened.net/2008/04/02/data-manipulation-in-vba-and-excel-its-slow-real-slow/comment-page-1#comment-15424</link>
		<dc:creator>Owen</dc:creator>
		<pubDate>Wed, 02 Apr 2008 11:12:01 +0000</pubDate>
		<guid isPermaLink="false">http://owened.net/?p=334#comment-15424</guid>
		<description>The problem with this is that the solution needs to be kept within Excel 2007. The Excel workbook is going to be moved around to different staff, so the entire solution needs to be portable.

I think I&#039;ll simply have to investigate ways to more efficiently manipulate the data, and also investigate the efficiency of my algorithm.</description>
		<content:encoded><![CDATA[<p>The problem with this is that the solution needs to be kept within Excel 2007. The Excel workbook is going to be moved around to different staff, so the entire solution needs to be portable.</p>
<p>I think I&#8217;ll simply have to investigate ways to more efficiently manipulate the data, and also investigate the efficiency of my algorithm.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tate</title>
		<link>http://owened.net/2008/04/02/data-manipulation-in-vba-and-excel-its-slow-real-slow/comment-page-1#comment-15423</link>
		<dc:creator>Tate</dc:creator>
		<pubDate>Wed, 02 Apr 2008 10:33:59 +0000</pubDate>
		<guid isPermaLink="false">http://owened.net/?p=334#comment-15423</guid>
		<description>Yeah, I&#039;m in agreement with Ashley. This sounds like the perfect opportunity to write a small, web based application (or something of that nature). However, I realise the practical implications of such an endeavour may make such a project less desirable. 

On the other hand, have you explored using Calc from Open Office? I&#039;m lead to believe you can script using a variety of languages such as Ruby, Python, etc.</description>
		<content:encoded><![CDATA[<p>Yeah, I&#8217;m in agreement with Ashley. This sounds like the perfect opportunity to write a small, web based application (or something of that nature). However, I realise the practical implications of such an endeavour may make such a project less desirable. </p>
<p>On the other hand, have you explored using Calc from Open Office? I&#8217;m lead to believe you can script using a variety of languages such as Ruby, Python, etc.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ash</title>
		<link>http://owened.net/2008/04/02/data-manipulation-in-vba-and-excel-its-slow-real-slow/comment-page-1#comment-15422</link>
		<dc:creator>Ash</dc:creator>
		<pubDate>Wed, 02 Apr 2008 08:54:48 +0000</pubDate>
		<guid isPermaLink="false">http://owened.net/?p=334#comment-15422</guid>
		<description>The fact that I don&#039;t really know VBA would have driven me to export your sheet to a CSV file and process it with some other scripting language. I&#039;m not sure if that&#039;s worthwhile or not in your case.</description>
		<content:encoded><![CDATA[<p>The fact that I don&#8217;t really know VBA would have driven me to export your sheet to a CSV file and process it with some other scripting language. I&#8217;m not sure if that&#8217;s worthwhile or not in your case.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

