<?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"
	>

<channel>
	<title>brentharvey.net</title>
	<atom:link href="http://brentharvey.net/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://brentharvey.net/blog</link>
	<description></description>
	<pubDate>Fri, 02 Jan 2009 20:23:02 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.5</generator>
	<language>en</language>
			<item>
		<title>Don&#8217;t rely on locking/password protecting to hide your data!</title>
		<link>http://brentharvey.net/blog/?p=24</link>
		<comments>http://brentharvey.net/blog/?p=24#comments</comments>
		<pubDate>Fri, 02 Jan 2009 20:19:23 +0000</pubDate>
		<dc:creator>Brent</dc:creator>
		
		<category><![CDATA[Excel]]></category>

		<guid isPermaLink="false">http://brentharvey.net/blog/?p=24</guid>
		<description><![CDATA[I&#8217;ve seen this a few too many times.  Someone wants to prevent the user of a spreadsheet from viewing detail data, so they hide the sheets (or cells), lock it, and password protect it.  In about 4 line of code, that data is visible again:
Sub copyWorkbook()
‘ Author: Brent Harvey
‘ Email: Excel.Examples@brentharvey.net
‘ Date: 01/02/2009
&#8216; Makes a [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve seen this a few too many times.  Someone wants to prevent the user of a spreadsheet from viewing detail data, so they hide the sheets (or cells), lock it, and password protect it.  In about 4 line of code, that data is visible again:</p>
<blockquote><p>Sub copyWorkbook()<br />
‘ Author: Brent Harvey<br />
‘ Email: Excel.Examples@brentharvey.net<br />
‘ Date: 01/02/2009<br />
&#8216; Makes a copy of a workbook&#8217;s values for each workbook</p>
<p>Sub copyWorkbook()<br />
    Dim sourceWB As Workbook, destWB As Workbook, sourceWS As Worksheet, destWS As Worksheet</p>
<p>    Set destWB = Workbooks(&#8221;Destination.xls&#8221;)<br />
    Set sourceWB = Workbooks(&#8221;Workbook_that_has_the_data_you_want.xls&#8221;)</p>
<p>     For Each destWS In destWB.Worksheets &#8216;I like to keep one workbook in there, just to avoid problems<br />
        If destWS.Name &lt;&gt; &#8220;__BLANK__&#8221; Then<br />
            destWS.Delete<br />
        End If<br />
    Next destWS<br />
   <br />
    &#8216;Here&#8217;s the important stuff<br />
    For Each sourceWS In sourceWB.Worksheets<br />
        destWB.Worksheets.Add().Name = sourceWS.Name<br />
        sourceWS.Range(&#8221;A:IV&#8221;).Copy (destWB.Worksheets(sourceWS.Name).Range(&#8221;A1&#8243;))<br />
    Next sourceWS<br />
   <br />
End Sub</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://brentharvey.net/blog/?feed=rss2&amp;p=24</wfw:commentRss>
		</item>
		<item>
		<title>Some automated graphing</title>
		<link>http://brentharvey.net/blog/?p=22</link>
		<comments>http://brentharvey.net/blog/?p=22#comments</comments>
		<pubDate>Mon, 05 May 2008 20:29:16 +0000</pubDate>
		<dc:creator>Brent</dc:creator>
		
		<category><![CDATA[Excel]]></category>

		<guid isPermaLink="false">http://brentharvey.net/blog/?p=22</guid>
		<description><![CDATA[Heres some code I&#8217;ve used in one form or another to add charts for multiple worksheets that have the same layout (like monthly breakdowns of data)  
For Each wSheet In Sheets
    Charts.Add
    ActiveChart.ChartType = xlLineMarkers
    ActiveChart.SetSourceData Source:=wSheet.Range(&#8221;B4:AX32&#8243;), PlotBy:=xlRows
    ActiveChart.SeriesCollection(1).Delete
    ActiveChart.Location Where:=xlLocationAsNewSheet, Name:=  &#8221;Graph_&#8221; &#38; wSheet.Name
    ActiveChart.HasLegend = True
    ActiveChart.Legend.Select
    Selection.Position = xlRight
    ActiveChart.SeriesCollection(1).Select
    ActiveChart.Deselect
    ActiveChart.Legend.Select
    Selection.AutoScaleFont = True
    With [...]]]></description>
			<content:encoded><![CDATA[<p>Heres some code I&#8217;ve used in one form or another to add charts for multiple worksheets that have the same layout (like monthly breakdowns of data)  </p>
<p>For Each wSheet In Sheets</p>
<p>    Charts.Add<br />
    ActiveChart.ChartType = xlLineMarkers<br />
    ActiveChart.SetSourceData Source:=wSheet.Range(&#8221;B4:AX32&#8243;), PlotBy:=xlRows<br />
    ActiveChart.SeriesCollection(1).Delete<br />
    ActiveChart.Location Where:=xlLocationAsNewSheet, Name:=  &#8221;Graph_&#8221; &amp; wSheet.Name<br />
    ActiveChart.HasLegend = True<br />
    ActiveChart.Legend.Select<br />
    Selection.Position = xlRight<br />
    ActiveChart.SeriesCollection(1).Select<br />
    ActiveChart.Deselect<br />
    ActiveChart.Legend.Select<br />
    Selection.AutoScaleFont = True<br />
    With Selection.Font<br />
        .Name = &#8220;Arial&#8221;<br />
        .FontStyle = &#8220;Regular&#8221;<br />
        .Size = 8<br />
        .Strikethrough = False<br />
        .Superscript = False<br />
        .Subscript = False<br />
        .OutlineFont = False<br />
        .Shadow = False<br />
        .Underline = xlUnderlineStyleNone<br />
        .ColorIndex = xlAutomatic<br />
        .Background = xlAutomatic<br />
    End With<br />
   <br />
    Next wSheet</p>
]]></content:encoded>
			<wfw:commentRss>http://brentharvey.net/blog/?feed=rss2&amp;p=22</wfw:commentRss>
		</item>
		<item>
		<title>Wharton article: Biased Expectations: Can Accounting Tools Lead to, Rather than Prevent, Executive Mistakes?</title>
		<link>http://brentharvey.net/blog/?p=21</link>
		<comments>http://brentharvey.net/blog/?p=21#comments</comments>
		<pubDate>Thu, 20 Mar 2008 13:02:39 +0000</pubDate>
		<dc:creator>Brent</dc:creator>
		
		<category><![CDATA[Articles]]></category>

		<category><![CDATA[Business]]></category>

		<guid isPermaLink="false">http://brentharvey.net/blog/?p=21</guid>
		<description><![CDATA[Here&#8217;s an interesting article (with links to underlying studies) from Knowledge@Wharton summarizing two studies by Gavin Cassar.  In one, he observes that (unsuprisingly)  &#8221;internal accounting report preparation significantly improves forecast accuracy&#8220;.  The catch is: &#8220;the accuracy benefits from internal reports preparation are only observed for firms with high uncertainty&#8221; in forecasting.
In his second study, he shows how some of [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://knowledge.wharton.upenn.edu/article.cfm?articleid=1922" title="Biased Expectations: Can Accounting Tools Lead to, Rather than Prevent, Executive Mistakes?">Here&#8217;s</a> an interesting article (with links to underlying studies) from <a href="http://knowledge.wharton.upenn.edu/" title="'Knowledge@Wharton'">Knowledge@Wharton</a> summarizing two studies by <a href="http://papers.ssrn.com/sol3/cf_dev/AbsByAuth.cfm?per_id=87548">Gavin Cassar</a>.  In one, he observes that (unsuprisingly)  &#8221;<font face="Arial">internal accounting report preparation significantly improves forecast accuracy</font>&#8220;.  The catch is: &#8220;<font face="Arial">the accuracy benefits from internal reports preparation are only observed for firms with high uncertainty</font>&#8221; in forecasting.</p>
<p>In his second study, he shows how some of these same tools can lead entrepreneurs to adopt overly optimistic outlooks for their company&#8217;s prospects.  I wonder if these entrepreneurs are using sensitivity and risk analysis to vet their forecasts, or are they getting a number they like, and calling it quits?</p>
]]></content:encoded>
			<wfw:commentRss>http://brentharvey.net/blog/?feed=rss2&amp;p=21</wfw:commentRss>
		</item>
		<item>
		<title>Get data from a cell in a closed workbook</title>
		<link>http://brentharvey.net/blog/?p=16</link>
		<comments>http://brentharvey.net/blog/?p=16#comments</comments>
		<pubDate>Mon, 17 Mar 2008 15:59:26 +0000</pubDate>
		<dc:creator>Brent</dc:creator>
		
		<category><![CDATA[Excel]]></category>

		<guid isPermaLink="false">http://brentharvey.net/blog/?p=16</guid>
		<description><![CDATA[There are lots of ways to get data from other workbooks.  This has helped when grabbing summary data for report summaries (see here for creating an email)
Example:
p = &#8220;\some\directory&#8221;
f = &#8220;Some fake file.xls&#8221;
s = &#8220;Sheet1&#8243;
a = &#8220;A1&#8243;
result = GetValue(p, f, s, a)
Private Function GetValue(path, file, sheet, ref)
‘ Author: Brent Harvey
‘ Email: Excel.Examples@brentharvey.net
‘ Date: 08/24/2006
&#8216; [...]]]></description>
			<content:encoded><![CDATA[<p>There are lots of ways to get data from other workbooks.  This has helped when grabbing summary data for report summaries (see here for <a href="http://brentharvey.net/blog/?p=15" title="Create an email and attach a spreadsheet">creating an email</a>)</p>
<p>Example:</p>
<p>p = &#8220;\some\directory&#8221;<br />
f = &#8220;Some fake file.xls&#8221;<br />
s = &#8220;Sheet1&#8243;<br />
a = &#8220;A1&#8243;<br />
result = GetValue(p, f, s, a)</p>
<blockquote><p>Private Function GetValue(path, file, sheet, ref)<br />
‘ Author: Brent Harvey<br />
‘ Email: Excel.Examples@brentharvey.net<br />
‘ Date: 08/24/2006<br />
&#8216; Source: <a href="http://www.j-walk.com/ss/excel/tips/tip82.htm">http://www.j-walk.com/ss/excel/tips/tip82.htm</a><br />
&#8216; Retrieves a value from a closed workbook</p>
<p>Dim arg As String&#8217;   Make sure the file exists<br />
If Right(path, 1) &lt;&gt; &#8220;\&#8221; Then path = path &amp; &#8220;\&#8221;<br />
If Dir(path &amp; file) = &#8220;&#8221; Then<br />
GetValue = &#8220;File Not Found&#8221;<br />
Exit Function<br />
End If</p>
<p>&#8216;   Create the argument<br />
arg = &#8220;&#8216;&#8221; &amp; path &amp; &#8220;[" &amp; file &amp; "]&#8221; &amp; sheet &amp; &#8220;&#8216;!&#8221; &amp; _<br />
range(ref).range(&#8221;A1&#8243;).Address(, , xlR1C1)</p>
<p>&#8216;   Execute an XLM macro<br />
GetValue = ExecuteExcel4Macro(arg)<br />
End Function</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://brentharvey.net/blog/?feed=rss2&amp;p=16</wfw:commentRss>
		</item>
		<item>
		<title>Create an email and attach a spreadsheet</title>
		<link>http://brentharvey.net/blog/?p=15</link>
		<comments>http://brentharvey.net/blog/?p=15#comments</comments>
		<pubDate>Wed, 12 Mar 2008 15:51:31 +0000</pubDate>
		<dc:creator>Brent</dc:creator>
		
		<category><![CDATA[Excel]]></category>

		<guid isPermaLink="false">http://brentharvey.net/blog/?p=15</guid>
		<description><![CDATA[As long as you&#8217;re automating your reports, you might as well automate the email notification!
Example:
strHTMLBody = &#8220;&#60;html&#62;Test Message,&#60;br/&#62;&#60;br/&#62;This is a test.  If this were not a test:&#8221; &#38; _
&#8220;&#60;ul&#62;&#60;li&#62;There would be useful information here&#60;/li&#62;&#60;li&#62;There would perhaps be more information here&#60;/li&#62;&#60;/ul&#62;&#60;br/&#62;Thank you&#60;/html&#62;&#8221;
Call CreateNewMail(&#8221;recipients@somedomain.com;morerecipients@anotherdomain.com&#8221;, &#8220;ccedfolks@adomain.com&#8221;, &#8220;Test Subject&#8221;, strHTMLBody,&#8221;Some fake file.xls&#8221;)
Make sure you enable Microsoft Outlook 11 [...]]]></description>
			<content:encoded><![CDATA[<p>As long as you&#8217;re automating your reports, you might as well automate the email notification!</p>
<p>Example:</p>
<p>strHTMLBody = &#8220;&lt;html&gt;Test Message,&lt;br/&gt;&lt;br/&gt;This is a test.  If this were not a test:&#8221; &amp; _<br />
&#8220;&lt;ul&gt;&lt;li&gt;There would be useful information here&lt;/li&gt;&lt;li&gt;There would perhaps be more information here&lt;/li&gt;&lt;/ul&gt;&lt;br/&gt;Thank you&lt;/html&gt;&#8221;</p>
<p>Call CreateNewMail(&#8221;recipients@somedomain.com;morerecipients@anotherdomain.com&#8221;, &#8220;ccedfolks@adomain.com&#8221;, &#8220;Test Subject&#8221;, strHTMLBody,&#8221;Some fake file.xls&#8221;)</p>
<p>Make sure you enable Microsoft Outlook 11 Object Library! (see code)</p>
<blockquote><p>Sub CreateNewMail(strRecipients As String, strCCs As String, strSubject As String, strBody As String, Optional strAttachPath As String)</p>
<p>&#8216;<br />
&#8216; Sub CreateNewMail<br />
&#8216; Author: Brent Harvey<br />
&#8216; Email: Excel.Examples@brentharvey.net<br />
&#8216; Date: 08/24/2006<br />
&#8216; Source:<br />
&#8216;   <a href="http://www.sitepoint.com/forums/showthread.php?t=406443">http://www.sitepoint.com/forums/showthread.php?t=406443</a><br />
&#8216; Creates email message to send report<br />
&#8216;   ToDo:<br />
&#8216;       Check for and load Outlook object library<br />
&#8216;In Visual Basic click on Tools, References and tick Microsoft Outlook 11 Object Library</p>
<p>Dim myOlApp As Outlook.Application<br />
Dim myItem As Outlook.MailItem<br />
Dim myRecipient As Outlook.Recipient<br />
Dim myCCRecipient As Outlook.Recipient<br />
Dim myBCCRecipient As Outlook.Recipient</p>
<p>Set myOlApp = CreateObject(&#8221;Outlook.Application&#8221;)<br />
Set myItem = myOlApp.CreateItem(olMailItem)<br />
Set myRecipient = myItem.Recipients.Add(strRecipients)<br />
Set myCCRecipient = myItem.Recipients.Add(strCCs)<br />
myCCRecipient.Type = olCC<br />
myItem.Subject = strSubject<br />
myItem.HTMLBody = strBody  &#8216;If you don&#8217;t want to use HTML Body, comment this line and uncomment the next<br />
&#8216;myItem.Body = strBody  &#8216;If you would rather use HTML Body, comment this line and uncomment the previous<br />
If (strAttachPath &lt;&gt; &#8220;&#8221;) Then<br />
Set myAttachments = myItem.Attachments<br />
myAttachments.Add strAttachPath<br />
End If</p>
<p>myItem.Display</p>
<p>End Sub</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://brentharvey.net/blog/?feed=rss2&amp;p=15</wfw:commentRss>
		</item>
		<item>
		<title>Last day of month for a date</title>
		<link>http://brentharvey.net/blog/?p=20</link>
		<comments>http://brentharvey.net/blog/?p=20#comments</comments>
		<pubDate>Thu, 06 Mar 2008 22:34:42 +0000</pubDate>
		<dc:creator>Brent</dc:creator>
		
		<category><![CDATA[Excel]]></category>

		<guid isPermaLink="false">http://brentharvey.net/blog/?p=20</guid>
		<description><![CDATA[When you create a date with the day part of 0, excel uses the last day of the previous month.
=DATE(YEAR(A1),MONTH(A1)+1,0)
Number of days in the month for a cell:
=DAY(DATE(YEAR(A1),MONTH(A1)+1,0))
]]></description>
			<content:encoded><![CDATA[<p>When you create a date with the day part of 0, excel uses the last day of the previous month.</p>
<p>=DATE(YEAR(A1),MONTH(A1)+1,0)</p>
<p>Number of days in the month for a cell:</p>
<p>=DAY(DATE(YEAR(A1),MONTH(A1)+1,0))</p>
]]></content:encoded>
			<wfw:commentRss>http://brentharvey.net/blog/?feed=rss2&amp;p=20</wfw:commentRss>
		</item>
		<item>
		<title>Eliminate prompt to update links</title>
		<link>http://brentharvey.net/blog/?p=19</link>
		<comments>http://brentharvey.net/blog/?p=19#comments</comments>
		<pubDate>Fri, 29 Feb 2008 22:33:04 +0000</pubDate>
		<dc:creator>Brent</dc:creator>
		
		<category><![CDATA[Excel]]></category>

		<guid isPermaLink="false">http://brentharvey.net/blog/?p=19</guid>
		<description><![CDATA[Not every post has to be about advanced concepts!
To turn off the &#8220;Do you want to update links&#8221; prompt from popping up every time you open a spreadsheet (you can still update links manually):
Edit &#124; Links&#8230;
Lower left corner, click on &#8220;Startup Prompt&#8230;&#8221;
Select &#8220;Don&#8217;t display the alert and don&#8217;t update automatic links&#8221;
OK
]]></description>
			<content:encoded><![CDATA[<p>Not every post has to be about advanced concepts!<br />
To turn off the &#8220;Do you want to update links&#8221; prompt from popping up every time you open a spreadsheet (you can still update links manually):</p>
<p>Edit | Links&#8230;</p>
<p>Lower left corner, click on &#8220;Startup Prompt&#8230;&#8221;</p>
<p>Select &#8220;Don&#8217;t display the alert and don&#8217;t update automatic links&#8221;</p>
<p>OK</p>
]]></content:encoded>
			<wfw:commentRss>http://brentharvey.net/blog/?feed=rss2&amp;p=19</wfw:commentRss>
		</item>
		<item>
		<title>Dynamic Named Range</title>
		<link>http://brentharvey.net/blog/?p=18</link>
		<comments>http://brentharvey.net/blog/?p=18#comments</comments>
		<pubDate>Fri, 29 Feb 2008 22:30:00 +0000</pubDate>
		<dc:creator>Brent</dc:creator>
		
		<category><![CDATA[Excel]]></category>

		<guid isPermaLink="false">http://brentharvey.net/blog/?p=18</guid>
		<description><![CDATA[If you want to reference a range whose size changes (for pivot tables, for example)
Insert&#124;Name&#124;Define&#8230;
Name the range, and in the refers to box:
=OFFSET(&#8217;Sheet Name&#8217;!$A$1,0,0,COUNTA(&#8217;Sheet Name&#8217;!$A:$A),COUNTA(&#8217;Sheet Name&#8217;!$1:$1))
the $A$1 is the upper left of the range (change as needed)
The first &#8220;COUNTA()&#8221; is the number of rows, and the second &#8220;COUNTA()&#8221; is the number of columns.
THIS ASSUMES THAT [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to reference a range whose size changes (for pivot tables, for example)</p>
<p>Insert|Name|Define&#8230;</p>
<p>Name the range, and in the refers to box:</p>
<p>=OFFSET(&#8217;Sheet Name&#8217;!$A$1,0,0,COUNTA(&#8217;Sheet Name&#8217;!$A:$A),COUNTA(&#8217;Sheet Name&#8217;!$1:$1))</p>
<p>the $A$1 is the upper left of the range (change as needed)</p>
<p>The first &#8220;COUNTA()&#8221; is the number of rows, and the second &#8220;COUNTA()&#8221; is the number of columns.</p>
<p>THIS ASSUMES THAT THERE ARE NO BLANK CELLS IN COLUMN A!!  If there are, you need to find another column with no blank cells, or insert one.  Then just change the reference in the first &#8220;COUNTA()&#8221; to that column.</p>
]]></content:encoded>
			<wfw:commentRss>http://brentharvey.net/blog/?feed=rss2&amp;p=18</wfw:commentRss>
		</item>
		<item>
		<title>Regular Expressions in Excel</title>
		<link>http://brentharvey.net/blog/?p=13</link>
		<comments>http://brentharvey.net/blog/?p=13#comments</comments>
		<pubDate>Fri, 22 Feb 2008 20:04:43 +0000</pubDate>
		<dc:creator>Brent</dc:creator>
		
		<category><![CDATA[Excel]]></category>

		<guid isPermaLink="false">http://brentharvey.net/blog/?p=13</guid>
		<description><![CDATA[Regular Expressions are very powerful pattern matching tools that can be used to find, return, or even substitute string patterns.
To use these, you&#8217;ll need to enable the VB Reg-ex Library:

In Visual Basic Editor - Tools&#124;References
Select &#8220;Microsoft VBScript Regular Expressions 5.5&#8243;

For Help with Regular Expressions, Google is your friend, but you might start here:
http://www.regular-expressions.info/reference.html
Here are a [...]]]></description>
			<content:encoded><![CDATA[<p>Regular Expressions are very powerful pattern matching tools that can be used to find, return, or even substitute string patterns.</p>
<p>To use these, you&#8217;ll need to enable the VB Reg-ex Library:</p>
<ul>
<li>In Visual Basic Editor - Tools|References</li>
<li>Select &#8220;Microsoft VBScript Regular Expressions 5.5&#8243;</li>
</ul>
<p>For Help with Regular Expressions, Google is your friend, but you might start here:</p>
<p><a href="http://www.regular-expressions.info/reference.html">http://www.regular-expressions.info/reference.html</a></p>
<p>Here are a couple I have found helpful:</p>
<blockquote><p> Public Function RegMatch(Source As String, Pattern As String, Optional IgnoreCase As Boolean = True, Optional MultiLine As Boolean = True) As Boolean<br />
‘ Author: Brent Harvey<br />
‘ Email: Excel.Examples@brentharvey.net<br />
‘ Date: 02/20/2007<br />
&#8216;This function returns whether or not the Source string contains the pattern<br />
&#8216; Modified from <a href="http://www.dailydoseofexcel.com/archives/2005/08/13/pattern-matching/">http://www.dailydoseofexcel.com/archives/2005/08/13/pattern-matching/</a></p>
<p>Dim reg As New RegExp<br />
reg.IgnoreCase = IgnoreCase<br />
reg.MultiLine = MultiLine<br />
reg.Pattern = Pattern<br />
RegMatch = reg.Test(Source)<br />
End Function</p></blockquote>
<p>This one returns the part(s) of the Source string that contain the pattern.  Could also be modded for replacement, but I think the link contains examples that already do that.</p>
<blockquote><p>Function RegExtract(Source As String, Pattern As String, Optional IgnoreCase As Boolean = True, Optional MultiLine As Boolean = True, Optional Glbal As Boolean = True) As String<br />
‘ Author: Brent Harvey<br />
‘ Email: Excel.Examples@brentharvey.net<br />
‘ Date: 02/20/2007<br />
&#8216; Modified from <a href="http://www.vbaexpress.com/kb/getarticle.php?kb_id=68">http://www.vbaexpress.com/kb/getarticle.php?kb_id=68</a><br />
&#8216; For help with regular expressions: <a href="http://www.regular-expressions.info/reference.html">http://www.regular-expressions.info/reference.html</a></p>
<p>&#8216;Dimension the RegExp objects<br />
Dim RegEx As Object, RegMatchCollection As Object, RegMatch As Object<br />
Dim Myrange As Range, C As Range, OutPutStr As String</p>
<p>&#8216; create the RegExp Object with late binding<br />
Set RegEx = CreateObject(&#8221;vbscript.regexp&#8221;)</p>
<p>&#8216; set the RegExp parameters<br />
With RegEx<br />
.IgnoreCase = IgnoreCase<br />
.MultiLine = MultiLine<br />
.Global = Glbal &#8216;Not sure what this does, don&#8217;t care right now<br />
.Pattern = Pattern<br />
End With</p>
<p>OutPutStr = &#8220;&#8221;<br />
Set RegMatchCollection = RegEx.Execute(Source)<br />
&#8216;Loop through each match in the string and concatenate them<br />
For Each RegMatch In RegMatchCollection<br />
OutPutStr = OutPutStr &amp; RegMatch<br />
Next<br />
&#8216;Put the extracted match into the corresponding B value cell<br />
RegExtract = OutPutStr</p>
<p>End Function</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://brentharvey.net/blog/?feed=rss2&amp;p=13</wfw:commentRss>
		</item>
		<item>
		<title>File name and path of current workbook</title>
		<link>http://brentharvey.net/blog/?p=14</link>
		<comments>http://brentharvey.net/blog/?p=14#comments</comments>
		<pubDate>Fri, 15 Feb 2008 15:43:16 +0000</pubDate>
		<dc:creator>Brent</dc:creator>
		
		<category><![CDATA[Excel]]></category>

		<guid isPermaLink="false">http://brentharvey.net/blog/?p=14</guid>
		<description><![CDATA[I&#8217;ve found this useful when working on files on a department shared drive.  I link it to a custom button on my toolbar, so I can just click the button and copy the full filename to the clipboard.
Sub copyFilePath()
&#8216; Sub copyFilePath
&#8216; Author: Brent Harvey
&#8216; Email: Excel.Examples@brentharvey.net
&#8216; Date: 02/20/2007
&#8216; Source:
&#8216;   http://www.cpearson.com/excel/clipboar.htm
&#8216; Copies path [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve found this useful when working on files on a department shared drive.  I link it to a custom button on my toolbar, so I can just click the button and copy the full filename to the clipboard.</p>
<blockquote><p>Sub copyFilePath()<br />
&#8216; Sub copyFilePath<br />
&#8216; Author: Brent Harvey<br />
&#8216; Email: Excel.Examples@brentharvey.net<br />
&#8216; Date: 02/20/2007<br />
&#8216; Source:<br />
&#8216;   <a href="http://www.cpearson.com/excel/clipboar.htm">http://www.cpearson.com/excel/clipboar.htm</a><br />
&#8216; Copies path and file name of active workbook to clipboard<br />
&#8216;Requires Microsoft Forms 2.0 Object Library<br />
&#8216;Click on Tools, References and tick Microsoft Forms 2.0 Object Library</p>
<p>Dim MyDataObj As New DataObject<br />
MyDataObj.SetText ActiveWorkbook.Path &amp; &#8220;\&#8221; &amp; ActiveWorkbook.Name<br />
MyDataObj.PutInClipboard<br />
End Sub</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://brentharvey.net/blog/?feed=rss2&amp;p=14</wfw:commentRss>
		</item>
	</channel>
</rss>
