<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>scott's spot</title>
	<atom:link href="http://scottclyerly.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://scottclyerly.wordpress.com</link>
	<description></description>
	<lastBuildDate>Fri, 03 Jul 2009 13:05:30 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='scottclyerly.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/faa5ba6df98f09f8ff0642735114cf78?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>scott's spot</title>
		<link>http://scottclyerly.wordpress.com</link>
	</image>
			<item>
		<title>Streamlining Recorded Code, part 3</title>
		<link>http://scottclyerly.wordpress.com/2009/07/03/streamlining-recorded-code-part-3/</link>
		<comments>http://scottclyerly.wordpress.com/2009/07/03/streamlining-recorded-code-part-3/#comments</comments>
		<pubDate>Fri, 03 Jul 2009 13:05:30 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Excel]]></category>
		<category><![CDATA[VBA]]></category>

		<guid isPermaLink="false">http://scottclyerly.wordpress.com/?p=85</guid>
		<description><![CDATA[So now that we&#8217;ve cleaned up some crap recorded code, and we&#8217;ve gotten past our first few checkpoints, we want to move the data itself. This is going to involve a couple of steps.
First thing is to clear the target, the place where we&#8217;re going to drop the copied data. To do this, we&#8217;ll activate [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=scottclyerly.wordpress.com&blog=1973483&post=85&subd=scottclyerly&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>So now that we&#8217;ve cleaned up some crap recorded code, and we&#8217;ve gotten past our first few checkpoints, we want to move the data itself. This is going to involve a couple of steps.</p>
<p>First thing is to clear the target, the place where we&#8217;re going to drop the copied data. To do this, we&#8217;ll activate the target sheet and place our selection in the very first cell of the range. Then we&#8217;ll &#8220;end down&#8221; the selection to highlight all of it. The last thing we&#8217;ll do is ClearContents.</p>
<p>So our code looks like this:</p>
<p><span style="font-family:Courier;">    TB.Activate<br />
    rngTB.Select<br />
    Range(Selection, Selection.End(xlDown)).Select<br />
    Selection.ClearContents</span></p>
<p>Time for a couple of caveats:</p>
<p>The first is the major one. The &#8220;end down&#8221; code will select all of the cells in the range PROVIDED THERE ARE NO EMPTY CELLS. If there is one single empty cell in the range, &#8220;end down&#8221; will stop just above it. So the big danger here is that you don&#8217;t select and clear all of the cells in your drop zone.</p>
<p>The second is minor and pertains to how you want to clear the data. If you want to clear the data and leave the formatting (which we have done here) we use .ClearContents. All this does is remove the data. If you want to clear EVERYTHING (formatting included) we&#8217;d use .Clear.</p>
<p>Now we&#8217;ll move our data. The data we want is spread over a couple of non-contiguous (a fancy way of say &#8220;not next to each other&#8221;) columns, or we need them in a different order then they appear in the source.</p>
<p>So, in the same way we prepped the target sheet, we activate the source, select the range, &#8220;end down&#8221; to grab the selection. Then we copy the selection.</p>
<p>Part of the beauty of streamlining this is that we don&#8217;t have to activate the target and select the drop zone each time. Here&#8217;s where our variable object come in very handy. By simply referencing the worksheet object variable we declared in part 2 of this blog sries, we can paste the data without flipping back and forth between sheets.</p>
<p><span style="font-family:Courier;">    <span style="color:#007F00;">&#8216; Let&#8217;s activate the styles sheet first.</span><br />
    Styles.Activate</p>
<p>    <span style="color:#007F00;">&#8216; Copy and paste the first range.</span><br />
    Styles.Range(&#8220;E6&#8243;).Select<br />
    Range(Selection, Selection.End(xlDown)).Select<br />
    Selection.Copy<br />
    ThinkBig.Range(&#8220;A25&#8243;).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _<br />
        :=False, Transpose:=<span style="color:#00007F;">False</span><br />
    Application.CutCopyMode = False     <span style="color:#007F00;">&#8216;clear the clipboard</span><br />
        <br />
    <span style="color:#007F00;">&#8216; Copy and paste the second range.</span><br />
    Styles.Range(&#8220;C6&#8243;).Select<br />
    Range(Selection, Selection.End(xlDown)).Select<br />
    Selection.Copy<br />
    ThinkBig.Range(&#8220;B25&#8243;).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _<br />
        :=<span style="color:#00007F;">False</span>, Transpose:=False<br />
    Application.CutCopyMode = <span style="color:#00007F;">False</span>     <span style="color:#007F00;">&#8216;clear the clipboard</span><br />
    <br />
    <span style="color:#007F00;">&#8216; Copy and paste the third range.</span><br />
    Styles.Range(&#8220;D6&#8243;).Select<br />
    Range(Selection, Selection.End(xlDown)).Select<br />
    Selection.Copy<br />
    ThinkBig.Range(&#8220;D25&#8243;).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _<br />
        :=False, Transpose:=<span style="color:#00007F;">False</span><br />
    Application.CutCopyMode = False     <span style="color:#007F00;">&#8216;clear the clipboard</span><br />
    <br />
    <span style="color:#007F00;">&#8216; Copy and paste the fourth range.</span><br />
    Styles.Range(&#8220;J6&#8243;).Select<br />
    Range(Selection, Selection.End(xlDown)).Select<br />
    Selection.Copy<br />
    ThinkBig.Range(&#8220;E25&#8243;).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _<br />
        :=False, Transpose:=False<br />
    Application.CutCopyMode = False     <span style="color:#007F00;">&#8216;clear the clipboard</span></span></p>
<p>You&#8217;ll notice that I clear the clipboard after each paste. It&#8217;s a easy way to keep the clipboard (and thus the data movement) clean.</p>
<p>So now our code is really coming together. And yet none of this has actually solved the original problem, created when an extra column was added. Sounds like a good topic for tomorrow&#8217;s post, part 4.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/scottclyerly.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/scottclyerly.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/scottclyerly.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/scottclyerly.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/scottclyerly.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/scottclyerly.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/scottclyerly.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/scottclyerly.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/scottclyerly.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/scottclyerly.wordpress.com/85/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=scottclyerly.wordpress.com&blog=1973483&post=85&subd=scottclyerly&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://scottclyerly.wordpress.com/2009/07/03/streamlining-recorded-code-part-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f359e6e85c71a603db923e50aa4af5d6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Scott</media:title>
		</media:content>
	</item>
		<item>
		<title>Streamlining Recorded Code, part 2</title>
		<link>http://scottclyerly.wordpress.com/2009/07/02/streamlining-recorded-code-part-2/</link>
		<comments>http://scottclyerly.wordpress.com/2009/07/02/streamlining-recorded-code-part-2/#comments</comments>
		<pubDate>Thu, 02 Jul 2009 11:06:55 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Excel]]></category>
		<category><![CDATA[VBA]]></category>

		<guid isPermaLink="false">http://scottclyerly.wordpress.com/?p=79</guid>
		<description><![CDATA[Now that we&#8217;ve eliminated the most obviously unneeded lines of VBA from the routine, we can start shaping this into something a little smoother.
The first thing I did was to add comments. I find, whether I&#8217;m coding for myself or a business partner, or whether I&#8217;m running through somebody else&#8217;s code and trying to understand [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=scottclyerly.wordpress.com&blog=1973483&post=79&subd=scottclyerly&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Now that we&#8217;ve eliminated the most obviously unneeded lines of VBA from the routine, we can start shaping this into something a little smoother.</p>
<p>The first thing I did was to add comments. I find, whether I&#8217;m coding for myself or a business partner, or whether I&#8217;m running through somebody else&#8217;s code and trying to understand its flow and function, by adding comments in plain old english, I get where I need to go just that much faster.</p>
<p>To that end, I added a couple of lines about what exactly we were doing with this routine right after I declared it.</p>
<p><span style="font-family:Courier;"><span style="color:#00007F;">Sub</span>mco_Populate()<br />
<span style="color:#007F00;">&#8216;   This routine moves data back and forth between two sheets</span><br />
<span style="color:#007F00;">&#8216;   in the same workbook, after first clearing out the old data,</span><br />
<span style="color:#007F00;">&#8216;   and ensuring that an autofilter is present.</span><br />
<span style="color:#007F00;">&#8216;</span><br />
<span style="color:#007F00;">&#8216;   Author: Scott Lyerly, scott[dot]c[dot]lyerly[at]hotmail[dot]com.</span><br />
<span style="color:#007F00;">&#8216;   Date: 5/7/2009.</span></span></p>
<p>I like to &#8220;sign and date&#8221; my code so that people know who did what and when (and how to get hold of me in case something goes wrong and needs to be fixed&#8211;not that anything ever goes wring in my code, of course&#8230;).</p>
<p>Once done, it was time to start making this thing over. I began by declaring some variables and then assigning values and objects to them:</p>
<p><span style="font-family:Courier;">    <span style="color:#007F00;">&#8216; Variable declarations.</span><br />
    <span style="color:#00007F;">Dim</span>ThisBook <span style="color:#00007F;">As</span> Workbook<br />
    <span style="color:#00007F;">Dim</span> Styles <span style="color:#00007F;">As</span> Worksheet, TB <span style="color:#00007F;">As</span> Worksheet<br />
    <span style="color:#00007F;">Dim</span>rngTB <span style="color:#00007F;">As</span> Range</span></p>
<p>    <span style="color:#007F00;font-family:Courier;">&#8216; Set the variables</span><br />
    <span style="font-family:Courier;">Set ThisBook = ThisWorkbook<br />
    Set Styles = ThisBook.Sheets(&#8220;Styles&#8221;)<br />
    Set TB = ThisBook.Sheets(&#8220;TB&#8221;)<br />
    Set rngTB = ThinkBig.Range(&#8220;A25:F26&#8243;)</span></p>
<p>First I declare the variables, then I assign them. Now, whenever I want to reference one of them, I don&#8217;t need to write something like:</p>
<p><span style="font-family:Courier;">ThisWorkbook.Sheets(&#8220;TB&#8221;).Range (&#8220;A25:F26&#8243;)</span></p>
<p>I can now just activate the sheet and reference the range variable:</p>
<p><span style="font-family:Courier;">   TB.Activate<br />
   rngTB.Select</span></p>
<p>This makes it worlds easier to maneuver through the workbook objects (books, sheets, ranges, cells, etc.). And if I need to change one (say the range for example) I change it in one spot, the place where I assigned it, rather than in each instance where the macro recorded (and hard-coded) the range reference.</p>
<p>The next thing I wanted to do was to ensure an autofilter was applied to the range from which I&#8217;ll copy. Since part of this process hinges on a certain field being filtered for &#8220;Y&#8221;, I felt it was important to double-check and make sure the filter was actually present.</p>
<p>To do this, I decided to declare a constant first:</p>
<p><span style="font-family:Courier;">    <span style="color:#007F00;">&#8216; Constant delcarations.</span><br />
    Const FilterCrit <span style="color:#00007F;">As</span> <span style="color:#00007F;">String</span> = &#8220;Y&#8221;</span></p>
<p>This was one of those thing I probably didn&#8217;t need to do, since we only apply the filter once, and it&#8217;s always &#8220;Y&#8221;, but I like things neat and tidy and having this &#8220;Y&#8221; as a constant gives me complete control over it. Now, instead of using &#8220;Y&#8221; in the filter criteria in the code, I can use the constant. And if I need to change the constant for some reason, I change it in its declaration, and lo! it&#8217;s good throughout the whole of the code anywhere it shows itself.</p>
<p>Then I needed to check to make sure a filter was applied:</p>
<p><span style="font-family:Courier;">    <span style="color:#007F00;">&#8216; Check to make sure an autofilter is actually present.</span><br />
    If <span style="color:#00007F;">Not</span>Styles.AutoFilterMode Then<br />
        MsgBox &#8220;There&#8217;s no autofilter here. Please apply an autofilter before continuing.&#8221;, vbOKOnly + vbExclamation<br />
    Exit <span style="color:#00007F;">Sub</span><br />
    <span style="color:#00007F;">End</span> If</span></p>
<p>    <span style="color:#007F00;font-family:Courier;">&#8216; If the our sub-routine is still running at this point, it&#8217;s safe to</span><br />
    <span style="color:#007F00;font-family:Courier;">&#8216; assume an autofilter exists in the sheet in question. Now we simply</span><br />
    <span style="color:#007F00;font-family:Courier;">&#8216; apply our constant, the criteria, to the filter.</span><br />
    <span style="font-family:Courier;">Selection.AutoFilter Field:=1, Criteria1:=FilterCrit.</span></p>
<p>And at the end of this snippet, I assign the constant to the appropriate autofilter field, which causes the sheet to become filtered.</p>
<p>So&#8230;we&#8217;ve streamlined out workbook object references, and we&#8217;ve made sure an autofilter exists and have applied it.</p>
<p>Our code clean-up to date:</p>
<p><span style="font-family:Courier;"><span style="color:#00007F;">Sub</span>mco_Populate()<br />
<span style="color:#007F00;">&#8216;   This routine moves data back and forth between two sheets</span><br />
<span style="color:#007F00;">&#8216;   in the same workbook, after first clearing out the old data,</span><br />
<span style="color:#007F00;">&#8216;   and ensuring that an autofilter is present.</span><br />
<span style="color:#007F00;">&#8216;</span><br />
<span style="color:#007F00;">&#8216;   Author: Scott Lyerly, scott[dot]c[dot]lyerly[at]hotmail[dot]com.</span><br />
<span style="color:#007F00;">&#8216;   Date: 5/7/2009.</span></span></p>
<p><span style="font-family:Courier;"><span style="color:#007F00;"> </span></span><br />
<span style="font-family:Courier;">    <span style="color:#007F00;">&#8216; Constant delcarations.</span><br />
    Const FilterCrit <span style="color:#00007F;">As</span> <span style="color:#00007F;">String</span> = &#8220;Y&#8221;</span></p>
<p><span style="font-family:Courier;"> </span><br />
<span style="font-family:Courier;">    <span style="color:#007F00;">&#8216; Variable declarations.</span><br />
    <span style="color:#00007F;">Dim</span>ThisBook <span style="color:#00007F;">As</span> Workbook<br />
    <span style="color:#00007F;">Dim</span> Styles <span style="color:#00007F;">As</span> Worksheet, TB <span style="color:#00007F;">As</span> Worksheet<br />
    <span style="color:#00007F;">Dim</span>rngTB <span style="color:#00007F;">As</span> Range<br />
    <span style="color:#007F00;">&#8216; Set the variables</span><br />
    Set ThisBook = ThisWorkbook<br />
    Set Styles = ThisBook.Sheets(&#8220;Styles&#8221;)<br />
    Set TB = ThisBook.Sheets(&#8220;TB&#8221;)<br />
    Set rngTB = ThinkBig.Range(&#8220;A25:F26&#8243;)</span></p>
<p><span style="font-family:Courier;"> </span><br />
<span style="font-family:Courier;">    <span style="color:#007F00;">&#8216; Activate the sheet that will be the source of our data.</span><br />
     Styles.Activate</span></p>
<p><span style="font-family:Courier;"> </span><br />
<span style="font-family:Courier;">    <span style="color:#007F00;">&#8216; Check to make sure an autofilter is actually present.</span><br />
    If <span style="color:#00007F;">Not</span>Styles.AutoFilterMode Then<br />
        MsgBox &#8220;There&#8217;s no autofilter here. Please apply an autofilter before continuing.&#8221;, vbOKOnly + vbExclamation<br />
    Exit <span style="color:#00007F;">Sub</span><br />
    <span style="color:#00007F;">End</span> If</span></p>
<p><span style="font-family:Courier;"><br />
    <span style="color:#007F00;">&#8216; If the our sub-routine is still running at this point, it&#8217;s safe to</span><br />
    <span style="color:#007F00;">&#8216; assume an autofilter exists in the sheet in question. Now we simply</span><br />
    <span style="color:#007F00;">&#8216; apply our constant, the criteria, to the filter.</span><br />
    Selection.AutoFilter Field:=1, Criteria1:=FilterCrit</span></p>
<p>On to the movement of data&#8230;our topic for tomorrow.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/scottclyerly.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/scottclyerly.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/scottclyerly.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/scottclyerly.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/scottclyerly.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/scottclyerly.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/scottclyerly.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/scottclyerly.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/scottclyerly.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/scottclyerly.wordpress.com/79/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=scottclyerly.wordpress.com&blog=1973483&post=79&subd=scottclyerly&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://scottclyerly.wordpress.com/2009/07/02/streamlining-recorded-code-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f359e6e85c71a603db923e50aa4af5d6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Scott</media:title>
		</media:content>
	</item>
		<item>
		<title>Streamlining Recorded Code, part 1</title>
		<link>http://scottclyerly.wordpress.com/2009/07/01/streamlining-recorded-code-part-1/</link>
		<comments>http://scottclyerly.wordpress.com/2009/07/01/streamlining-recorded-code-part-1/#comments</comments>
		<pubDate>Wed, 01 Jul 2009 11:45:44 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Excel]]></category>
		<category><![CDATA[VBA]]></category>

		<guid isPermaLink="false">http://scottclyerly.wordpress.com/?p=77</guid>
		<description><![CDATA[A firend of mine dropped me a line a few weeks ago regarding a macro he was having trouble with.  This friend is a good guy, and he knows a bit of VBA, but not enough to really rework something. It&#8217;s a kind of &#8220;just enough to be dangerous&#8221; scenario.
Anyway, he had recorded a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=scottclyerly.wordpress.com&blog=1973483&post=77&subd=scottclyerly&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>A firend of mine dropped me a line a few weeks ago regarding a macro he was having trouble with.  This friend is a good guy, and he knows a bit of VBA, but not enough to really rework something. It&#8217;s a kind of &#8220;just enough to be dangerous&#8221; scenario.</p>
<p>Anyway, he had recorded a macro that applied a criteria to one of the filters in an autofilter on a specific sheet, and then copy/pasted data from various columns and rows to a different sheet. Problem is, at some point he needed to add a column to the source sheet. Suddenly everything stopped working correctly.</p>
<p>Sounds easy enough, right? Straight-forward to correct? Sure.</p>
<p>Except it&#8217;s not.</p>
<p>Because, when you use Excel&#8217;s macro recorder, you get what can only be described as a whole bunch of crap.  The recorder adds a ton of stuff that you do that you don&#8217;t really need.  Scrolling is a good example of this. Does anyone actually need to automate scrolling? I never have. But hey, maybe I&#8217;m missing something.</p>
<p>In any event, the code snippet my friend sent to me is below (names changed to protect the innocent!). What I thought I&#8217;d do is, over the next few posts, show what I did to clean the code up.</p>
<p>First his code. And right off the bat, I eliminated the ActiveWindow.ScrollRow, which automatically made his code smaller:</p>
<p> <span style="font-family:Courier;"><span style="color:#00007F;">Sub</span> mco_Populate()<br />
<span style="color:#007F00;">&#8216;</span><br />
<span style="color:#007F00;">&#8216; mco_Populate Macro</span><br />
<span style="color:#007F00;">&#8216; Macro recorded 4/2/2009 by</span><br />
<span style="color:#007F00;">&#8216; Keyboard Shortcut: Ctrl+k</span><br />
<span style="color:#007F00;">&#8216;</span><br />
    Sheets(&#8220;Styles&#8221;).Select<br />
    Selection.AutoFilter Field:=1, Criteria1:=&#8221;Y&#8221;<br />
    Sheets(&#8220;TB&#8221;).Select<br />
    Range(&#8220;A25:F26&#8243;).Select<br />
    Range(Selection, Selection.End(xlDown)).Select<br />
    Selection.ClearContents<br />
    Sheets(&#8220;Styles&#8221;).Select<br />
    Range(&#8220;E6&#8243;).Select<br />
    Range(Selection, Selection.End(xlDown)).Select<br />
    Selection.Copy<br />
    Sheets(&#8220;TB&#8221;).Select<br />
    Range(&#8220;A25&#8243;).Select<br />
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _<br />
        :=False, Transpose:=<span style="color:#00007F;">False</span><br />
    Sheets(&#8220;Styles&#8221;).Select<br />
    ActiveWindow.ScrollRow = 854<br />
    ActiveWindow.ScrollRow = 852<br />
    ActiveWindow.ScrollRow = 847<br />
    ActiveWindow.ScrollRow = 836<br />
    ActiveWindow.ScrollRow = 826<br />
    ActiveWindow.ScrollRow = 803<br />
    ActiveWindow.ScrollRow = 747<br />
    ActiveWindow.ScrollRow = 660<br />
    ActiveWindow.ScrollRow = 563<br />
    ActiveWindow.ScrollRow = 491<br />
    ActiveWindow.ScrollRow = 422<br />
    ActiveWindow.ScrollRow = 382<br />
    ActiveWindow.ScrollRow = 325<br />
    ActiveWindow.ScrollRow = 264<br />
    ActiveWindow.ScrollRow = 208<br />
    ActiveWindow.ScrollRow = 164<br />
    ActiveWindow.ScrollRow = 124<br />
    ActiveWindow.ScrollRow = 93<br />
    ActiveWindow.ScrollRow = 78<br />
    ActiveWindow.ScrollRow = 70<br />
    ActiveWindow.ScrollRow = 67<br />
    ActiveWindow.ScrollRow = 65<br />
    ActiveWindow.ScrollRow = 60<br />
    ActiveWindow.ScrollRow = 55<br />
    ActiveWindow.ScrollRow = 52<br />
    ActiveWindow.ScrollRow = 47<br />
    ActiveWindow.ScrollRow = 44<br />
    ActiveWindow.ScrollRow = 39<br />
    ActiveWindow.ScrollRow = 37<br />
    ActiveWindow.ScrollRow = 34<br />
    ActiveWindow.ScrollRow = 32<br />
    ActiveWindow.ScrollRow = 29<br />
    ActiveWindow.ScrollRow = 26<br />
    ActiveWindow.ScrollRow = 24<br />
    ActiveWindow.ScrollRow = 21<br />
    ActiveWindow.ScrollRow = 19<br />
    ActiveWindow.ScrollRow = 16<br />
    ActiveWindow.ScrollRow = 14<br />
    ActiveWindow.ScrollRow = 11<br />
    ActiveWindow.ScrollRow = 9<br />
    ActiveWindow.ScrollRow = 6<br />
    Range(&#8220;C6&#8243;).Select<br />
    Range(Selection, Selection.End(xlDown)).Select<br />
    Application.CutCopyMode = False<br />
    Selection.Copy<br />
    Sheets(&#8220;TB&#8221;).Select<br />
    Range(&#8220;B25&#8243;).Select<br />
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _<br />
        :=<span style="color:#00007F;">False</span>, Transpose:=False<br />
    Sheets(&#8220;Styles&#8221;).Select<br />
    ActiveWindow.ScrollRow = 854<br />
    ActiveWindow.ScrollRow = 852<br />
    ActiveWindow.ScrollRow = 844<br />
    ActiveWindow.ScrollRow = 839<br />
    ActiveWindow.ScrollRow = 824<br />
    ActiveWindow.ScrollRow = 806<br />
    ActiveWindow.ScrollRow = 780<br />
    ActiveWindow.ScrollRow = 719<br />
    ActiveWindow.ScrollRow = 604<br />
    ActiveWindow.ScrollRow = 514<br />
    ActiveWindow.ScrollRow = 417<br />
    ActiveWindow.ScrollRow = 341<br />
    ActiveWindow.ScrollRow = 272<br />
    ActiveWindow.ScrollRow = 251<br />
    ActiveWindow.ScrollRow = 241<br />
    ActiveWindow.ScrollRow = 233<br />
    ActiveWindow.ScrollRow = 226<br />
    ActiveWindow.ScrollRow = 210<br />
    ActiveWindow.ScrollRow = 187<br />
    ActiveWindow.ScrollRow = 144<br />
    ActiveWindow.ScrollRow = 78<br />
    ActiveWindow.ScrollRow = 34<br />
    ActiveWindow.ScrollRow = 9<br />
    ActiveWindow.ScrollRow = 6<br />
    Range(&#8220;D6&#8243;).Select<br />
    Range(Selection, Selection.End(xlDown)).Select<br />
    Application.CutCopyMode = <span style="color:#00007F;">False</span><br />
    Selection.Copy<br />
    Sheets(&#8220;TB&#8221;).Select<br />
    Range(&#8220;D25&#8243;).Select<br />
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _<br />
        :=False, Transpose:=False<br />
    Sheets(&#8220;Styles&#8221;).Select<br />
    ActiveWindow.ScrollRow = 854<br />
    ActiveWindow.ScrollRow = 852<br />
    ActiveWindow.ScrollRow = 844<br />
    ActiveWindow.ScrollRow = 836<br />
    ActiveWindow.ScrollRow = 816<br />
    ActiveWindow.ScrollRow = 788<br />
    ActiveWindow.ScrollRow = 729<br />
    ActiveWindow.ScrollRow = 619<br />
    ActiveWindow.ScrollRow = 509<br />
    ActiveWindow.ScrollRow = 420<br />
    ActiveWindow.ScrollRow = 333<br />
    ActiveWindow.ScrollRow = 259<br />
    ActiveWindow.ScrollRow = 216<br />
    ActiveWindow.ScrollRow = 167<br />
    ActiveWindow.ScrollRow = 134<br />
    ActiveWindow.ScrollRow = 111<br />
    ActiveWindow.ScrollRow = 93<br />
    ActiveWindow.ScrollRow = 78<br />
    ActiveWindow.ScrollRow = 62<br />
    ActiveWindow.ScrollRow = 49<br />
    ActiveWindow.ScrollRow = 39<br />
    ActiveWindow.ScrollRow = 32<br />
    ActiveWindow.ScrollRow = 26<br />
    ActiveWindow.ScrollRow = 24<br />
    ActiveWindow.ScrollRow = 19<br />
    ActiveWindow.ScrollRow = 14<br />
    ActiveWindow.ScrollRow = 11<br />
    ActiveWindow.ScrollRow = 6<br />
    Range(&#8220;J6&#8243;).Select<br />
    Range(Selection, Selection.End(xlDown)).Select<br />
    Application.CutCopyMode = False<br />
    Selection.Copy<br />
    Sheets(&#8220;TB&#8221;).Select<br />
    Range(&#8220;E25&#8243;).Select<br />
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _<br />
        :=False, Transpose:=False<br />
    Range(&#8220;A1&#8243;).Select<br />
<span style="color:#00007F;">End</span> <span style="color:#00007F;">Sub</span></span></p>
<p>became</p>
<p><span style="font-family:Courier;"><span style="color:#00007F;">Sub</span> mco_Populate()<br />
<span style="color:#007F00;">&#8216;</span><br />
<span style="color:#007F00;">&#8216; mco_Populate Macro</span><br />
<span style="color:#007F00;">&#8216; Macro recorded 4/2/2009 by</span><br />
<span style="color:#007F00;">&#8216; Keyboard Shortcut: Ctrl+k</span><br />
<span style="color:#007F00;">&#8216;</span><br />
    Sheets(&#8220;Styles&#8221;).Select<br />
    Selection.AutoFilter Field:=1, Criteria1:=&#8221;Y&#8221;<br />
    Sheets(&#8220;TB&#8221;).Select<br />
    Range(&#8220;A25:F26&#8243;).Select<br />
    Range(Selection, Selection.End(xlDown)).Select<br />
    Selection.ClearContents<br />
    Sheets(&#8220;Styles&#8221;).Select<br />
    Range(&#8220;E6&#8243;).Select<br />
    Range(Selection, Selection.End(xlDown)).Select<br />
    Selection.Copy<br />
    Sheets(&#8220;TB&#8221;).Select<br />
    Range(&#8220;A25&#8243;).Select<br />
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _<br />
        :=False, Transpose:=<span style="color:#00007F;">False</span><br />
    Sheets(&#8220;Styles&#8221;).Select<br />
    Range(&#8220;C6&#8243;).Select<br />
    Range(Selection, Selection.End(xlDown)).Select<br />
    Application.CutCopyMode = False<br />
    Selection.Copy<br />
    Sheets(&#8220;TB&#8221;).Select<br />
    Range(&#8220;B25&#8243;).Select<br />
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _<br />
        :=<span style="color:#00007F;">False</span>, Transpose:=False<br />
    Sheets(&#8220;Styles&#8221;).Select<br />
    Range(&#8220;D6&#8243;).Select<br />
    Range(Selection, Selection.End(xlDown)).Select<br />
    Application.CutCopyMode = <span style="color:#00007F;">False</span><br />
    Selection.Copy<br />
    Sheets(&#8220;TB&#8221;).Select<br />
    Range(&#8220;D25&#8243;).Select<br />
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _<br />
        :=False, Transpose:=False<br />
    Sheets(&#8220;Styles&#8221;).Select<br />
    Range(&#8220;J6&#8243;).Select<br />
    Range(Selection, Selection.End(xlDown)).Select<br />
    Application.CutCopyMode = False<br />
    Selection.Copy<br />
    Sheets(&#8220;TB&#8221;).Select<br />
    Range(&#8220;E25&#8243;).Select<br />
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _<br />
        :=False, Transpose:=False<br />
    Range(&#8220;A1&#8243;).Select<br />
<span style="color:#00007F;">End</span> <span style="color:#00007F;">Sub</span></span></p>
<p>Very quickly this seems a lot more manageable.  Tomorrow, we&#8217;ll streamline his references and make sure the sheet is ready for some copy/paste action!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/scottclyerly.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/scottclyerly.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/scottclyerly.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/scottclyerly.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/scottclyerly.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/scottclyerly.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/scottclyerly.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/scottclyerly.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/scottclyerly.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/scottclyerly.wordpress.com/77/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=scottclyerly.wordpress.com&blog=1973483&post=77&subd=scottclyerly&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://scottclyerly.wordpress.com/2009/07/01/streamlining-recorded-code-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f359e6e85c71a603db923e50aa4af5d6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Scott</media:title>
		</media:content>
	</item>
		<item>
		<title>Passing Paramters to an Access query from Excel</title>
		<link>http://scottclyerly.wordpress.com/2009/06/30/passing-paramters-to-an-access-query-from-excel/</link>
		<comments>http://scottclyerly.wordpress.com/2009/06/30/passing-paramters-to-an-access-query-from-excel/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 11:50:40 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Excel]]></category>
		<category><![CDATA[VBA]]></category>

		<guid isPermaLink="false">http://scottclyerly.wordpress.com/?p=72</guid>
		<description><![CDATA[So, since I spend so much time in Excel, I thought I&#8217;d do some blogging about my favorite business application. Yes, I&#8217;m a geek, I know. Sue me.
Recently I was trying to figure our how to change an Access query from Excel. By way of some background, I have a report that is generated in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=scottclyerly.wordpress.com&blog=1973483&post=72&subd=scottclyerly&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>So, since I spend so much time in Excel, I thought I&#8217;d do some blogging about my favorite business application. Yes, I&#8217;m a geek, I know. Sue me.</p>
<p>Recently I was trying to figure our how to change an Access query from Excel. By way of some background, I have a report that is generated in Excel via a number of SQL statements passed from Excel to Access via ADO, and the resulting recordset dropped into data sheets in the Excel file.  Okay, fine, no problem. There are endless examples on the web of how to do this. However&#8230;</p>
<p>I was recently tasked with resdesigning what I had originally designed to make it a little more portable. So, in that respect, I needed to pass a single criteria (or parameter) back to an Access query that I had created as part of the overall report function. This query is a time-based query, setting a week number as chosen by a user.</p>
<p>The previous method I used was a number of individual data files, each of which contained Sales and other data up to that week. In other words, the week 1 file had data from week 1, the week 2 file had data from weeks 1 and 2, the week 3 file had weeks 1, 2, and 3, blah blah, etc etc. The purpose of this was to help isolate a beginning of period number and and end of period inventory number.</p>
<p>(The yawn you just heard was my wife dropping off to sleep at this point.)</p>
<p>What I needed to do was to run with a single data set, but allow the users to choose the week they wanted to report on. But to do that, I needed one of the base queries to accept a criteria of that particular week number, and since the report is generated in Excel, I needed to pass that query parameter as part of the report engine.</p>
<p>Okay, so why pass a parameter? Why not just submit the SQL as a command? Because this parameter-accepting query is the basis for sub-queries that allow the whole thing the run (the final SQl statement is an ugly, ugly beast.)</p>
<p>All this being said, I tried a couple of things before landing on the solution. I tried using ADO to change the query, tried ADOX, and final landed on a hybird solution of sorts.</p>
<p>First, I needed an instance of the Access application, so I defined a very generic Object variable and then used CreateObject to create an instance of Access.</p>
<p>Then, using a reference to the Access object library, I was able to use commands normally found in the Access object model to do the work I was trying to do. The work, by the way, was simply to change the QueryDef in the one query and save it.</p>
<p>After some testing, debugging, and commenting, I nailed the solution.</p>
<p>And here it is, heavily commented for your reading enjoyment:</p>
<p><span style="font-family:Courier;"><span style="color:#00007F;">Sub</span> Pass_Parameter_To_MaxTimeQry(sWeek <span style="color:#00007F;">As</span> <span style="color:#00007F;">String</span>)<br />
<span style="color:#007F00;">&#8216;   This passes a parameter to the max of time qry in order</span><br />
<span style="color:#007F00;">&#8216;   to enable dynamic time period run of the report.</span><br />
<span style="color:#007F00;">&#8216;</span><br />
<span style="color:#007F00;">&#8216;   NOTE: in order to run this, you&#8217;ll need a reference to the</span><br />
<span style="color:#007F00;">&#8216;   Microsoft DAO X.X Object Libray.</span><br />
    <br />
    <span style="color:#007F00;">&#8216; Some variables</span><br />
    <span style="color:#00007F;">Dim</span> sDBPath <span style="color:#00007F;">As</span> <span style="color:#00007F;">String</span>       <span style="color:#007F00;">&#8216; This is the path of the DB.</span><br />
    <span style="color:#00007F;">Dim</span> sDBName <span style="color:#00007F;">As</span> <span style="color:#00007F;">String</span>       <span style="color:#007F00;">&#8216; This is the name of the DB</span><br />
    <span style="color:#00007F;">Dim</span> accObj <span style="color:#00007F;">As</span> <span style="color:#00007F;">Object</span>        <span style="color:#007F00;">&#8216; This will be our Access object</span><br />
    <span style="color:#00007F;">Dim</span> dbs <span style="color:#00007F;">As</span> DataBase         <span style="color:#007F00;">&#8216; This is the database object we&#8217;ll use (requires the reference)</span><br />
    <span style="color:#00007F;">Dim</span> qryDef <span style="color:#00007F;">As</span> QueryDef      <span style="color:#007F00;">&#8216; This is the query definition we&#8217;ll use (requires the reference)</span><br />
    <span style="color:#00007F;">Dim</span> sSQL <span style="color:#00007F;">As</span> <span style="color:#00007F;">String</span>          <span style="color:#007F00;">&#8216; This is our SQL string.</span><br />
    <span style="color:#00007F;">Dim</span> sQueryName <span style="color:#00007F;">As</span> <span style="color:#00007F;">String</span>    <span style="color:#007F00;">&#8216; This is our query name.</span><br />
    <br />
    <span style="color:#007F00;">&#8216; We&#8217;ll start out by setting the string variables.</span><br />
    <br />
    <span style="color:#007F00;">&#8216;   The DB path and name are acutally global constants I use elsewhere,</span><br />
    <span style="color:#007F00;">&#8216;   so I don&#8217;t set them specifically here.</span><br />
    sDBPath = msDATA_FILE_PATH<br />
    sDBName = msDATABASE_NAME<br />
    <span style="color:#007F00;">&#8216;   This is the name of the query we&#8217;ll be changing.</span><br />
    sQueryName = &#8220;qryTimeMaxes&#8221;<br />
    <span style="color:#007F00;">&#8216;   This is out SQL statement: the dynamic part that will be fed</span><br />
    <span style="color:#007F00;">&#8216;   from a user form is the Week field.</span><br />
    sSQL = &#8220;SELECT Max(MonRptData.Year) AS MaxOfYear, Max(MonRptData.[Fiscal Season]) AS [MaxOfFiscal Season], Max(MonRptData.[Fiscal Quarter]) AS [MaxOfFiscal Quarter], Max(MonRptData.Month) AS MaxOfMonth, MonRptData.Week &#8221; _<br />
            &amp; &#8220;FROM MonRptData &#8221; _<br />
            &amp; &#8220;GROUP BY MonRptData.Week &#8221; _<br />
            &amp; &#8220;HAVING (((MonRptData.Week)=&#8221; &amp; sWeek &amp; &#8220;));&#8221;<br />
    <br />
    <span style="color:#007F00;">&#8216; Now we&#8217;ll play with our objects (nothing dirty!)</span><br />
    <br />
    <span style="color:#007F00;">&#8216;   First we set the access object. The access object isn&#8217;t really an</span><br />
    <span style="color:#007F00;">&#8216;   access object at all, just a plain old ordinary object that we make</span><br />
    <span style="color:#007F00;">&#8216;   into an access object using the &#8220;Access.Application&#8221; string.</span><br />
    <span style="color:#00007F;">Set</span> accObj = CreateObject(&#8220;Access.Application&#8221;)</p>
<p>    <span style="color:#007F00;">&#8216;   Then we open the object, using an access object model method,</span><br />
    <span style="color:#007F00;">&#8216;   OpenCurrentDatabase, the the DB set by our path and DB name strings.</span><br />
    accObj.OpenCurrentDatabase sDBPath &amp; sDBName, <span style="color:#00007F;">False</span><br />
    <br />
    <span style="color:#007F00;">&#8216;   Next we&#8217;ll set the database variable to the database we&#8217;ve just opened.</span><br />
    <span style="color:#007F00;">&#8216;   Note that, because we didn&#8217;t make our DB visible when we opened it, you can&#8217;t</span><br />
    <span style="color:#007F00;">&#8216;   see it, but it&#8217;s open nevertheless.</span><br />
    <span style="color:#00007F;">Set</span> dbs = accObj.CurrentDb<br />
    <br />
    <span style="color:#007F00;">&#8216;   Now we&#8217;ll get into the query itself.</span><br />
    <span style="color:#007F00;">&#8216;   First we delete the old one&#8230;</span><br />
    dbs.QueryDefs.Delete sQueryName<br />
    <span style="color:#007F00;">&#8216;   &#8230; then we recreate it with our new SQL string</span><br />
    <span style="color:#00007F;">Set</span> qryDef = dbs.CreateQueryDef(sQueryName, sSQL)</p>
<p>    <span style="color:#007F00;">&#8216; That&#8217;s it. The only left if to clean up. We&#8217;ll close the database&#8230;</span><br />
    dbs.Close<br />
    <span style="color:#007F00;">&#8216; &#8230;then destroy our objects to free up all the juicy memory they take up.</span><br />
    <span style="color:#00007F;">Set</span> qryDef = <span style="color:#00007F;">Nothing</span><br />
    <span style="color:#00007F;">Set</span> dbs = <span style="color:#00007F;">Nothing</span><br />
    <span style="color:#00007F;">Set</span> accObj = <span style="color:#00007F;">Nothing</span><br />
    <br />
<span style="color:#00007F;">End</span> <span style="color:#00007F;">Sub</span></span></p>
<p>You can see there&#8217;s no error handling here, and that&#8217;s a flaw, but an easy one to fix.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/scottclyerly.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/scottclyerly.wordpress.com/72/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/scottclyerly.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/scottclyerly.wordpress.com/72/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/scottclyerly.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/scottclyerly.wordpress.com/72/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/scottclyerly.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/scottclyerly.wordpress.com/72/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/scottclyerly.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/scottclyerly.wordpress.com/72/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=scottclyerly.wordpress.com&blog=1973483&post=72&subd=scottclyerly&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://scottclyerly.wordpress.com/2009/06/30/passing-paramters-to-an-access-query-from-excel/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f359e6e85c71a603db923e50aa4af5d6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Scott</media:title>
		</media:content>
	</item>
		<item>
		<title>Where was I&#8230;?</title>
		<link>http://scottclyerly.wordpress.com/2009/06/30/where-was-i/</link>
		<comments>http://scottclyerly.wordpress.com/2009/06/30/where-was-i/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 11:43:27 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://scottclyerly.wordpress.com/?p=70</guid>
		<description><![CDATA[Oh yeah, I have a blog&#8230;I&#8217;ll have to think of something to write about&#8230;
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=scottclyerly.wordpress.com&blog=1973483&post=70&subd=scottclyerly&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Oh yeah, I have a blog&#8230;I&#8217;ll have to think of something to write about&#8230;</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/scottclyerly.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/scottclyerly.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/scottclyerly.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/scottclyerly.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/scottclyerly.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/scottclyerly.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/scottclyerly.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/scottclyerly.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/scottclyerly.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/scottclyerly.wordpress.com/70/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=scottclyerly.wordpress.com&blog=1973483&post=70&subd=scottclyerly&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://scottclyerly.wordpress.com/2009/06/30/where-was-i/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f359e6e85c71a603db923e50aa4af5d6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Scott</media:title>
		</media:content>
	</item>
	</channel>
</rss>