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

<channel>
	<title>SynapSonic Software</title>
	<atom:link href="http://synapsonic.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>https://synapsonic.com</link>
	<description>SynapSonic Medical Software</description>
	<lastBuildDate>Thu, 14 Mar 2019 21:01:50 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://synapsonic.com/wp-content/uploads/2017/05/cropped-SigOlSquare2-32x32.jpg</url>
	<title>SynapSonic Software</title>
	<link>https://synapsonic.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Ol Monitor 2.0 Live Demo</title>
		<link>https://synapsonic.com/?p=648</link>
					<comments>https://synapsonic.com/?p=648#respond</comments>
		
		<dc:creator><![CDATA[ericains]]></dc:creator>
		<pubDate>Thu, 14 Mar 2019 21:01:50 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">http://synapsonic.com/?p=648</guid>

					<description><![CDATA[]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-embed-youtube wp-block-embed is-type-video is-provider-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe title="Ol Monitor 2 0 live demo" width="640" height="360" src="https://www.youtube.com/embed/ZWzQYbjaNwk?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
</div></figure>
]]></content:encoded>
					
					<wfw:commentRss>https://synapsonic.com/?feed=rss2&#038;p=648</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>OL Monitor 2.0 released</title>
		<link>https://synapsonic.com/?p=645</link>
					<comments>https://synapsonic.com/?p=645#respond</comments>
		
		<dc:creator><![CDATA[ericains]]></dc:creator>
		<pubDate>Tue, 05 Mar 2019 23:11:35 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">http://synapsonic.com/?p=645</guid>

					<description><![CDATA[Read all about it here:]]></description>
										<content:encoded><![CDATA[
<p>Read all about it here:</p>



<figure class="wp-block-embed-wordpress wp-block-embed is-type-wp-embed is-provider-ol-monitor-blog"><div class="wp-block-embed__wrapper">
http://olmonitorblog.azurewebsites.net/?p=1324
</div></figure>
]]></content:encoded>
					
					<wfw:commentRss>https://synapsonic.com/?feed=rss2&#038;p=645</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Folders used by Ol Monitor</title>
		<link>https://synapsonic.com/?p=569</link>
					<comments>https://synapsonic.com/?p=569#respond</comments>
		
		<dc:creator><![CDATA[ericains]]></dc:creator>
		<pubDate>Wed, 02 Nov 2016 16:15:20 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">http://synapsonic.com/?p=569</guid>

					<description><![CDATA[Ol Monitor does it&#8217;s best to restrict the folders it works with to just one, the &#8220;Public\Documents\OlMonitor&#8221; folder. Normally the Public folder is found on the C drive: &#8220;C:\Users\Public\Documents\Olmonitor&#8221; Of course Ol Monitor does read (but not write), to it&#8217;s folder in Program Files: &#8220;C:\Program Files (x86)\OLMonitor VIM&#8221; Normally you would never have to check file permissions on this folder. The other folder you might have to set is the Smarterm Sessions folder. Where/how to find the Smarterm Sessions folder:...<p class="read-more"><a class="btn btn-default" href="https://synapsonic.com/?p=569"> Read More<span class="screen-reader-text">  Read More</span></a></p>]]></description>
										<content:encoded><![CDATA[<div>
<p>Ol Monitor does it&#8217;s best to restrict the folders it works with to just one, the &#8220;Public\Documents\OlMonitor&#8221; folder.</p>
<div>Normally the Public folder is found on the C drive:<br />
&#8220;C:\Users\Public\Documents\<wbr />Olmonitor&#8221;</div>
<div>Of course Ol Monitor does read (but not write), to it&#8217;s folder in Program Files:<br />
&#8220;C:\Program Files (x86)\OLMonitor VIM&#8221;</div>
<div>
<p>Normally you would never have to check file permissions on this folder.</p>
</div>
<div>The other folder you might have to set is the Smarterm Sessions folder.</div>
<div><b>Where/how to find the Smarterm Sessions folder:</b><br />
The most likely locations will be:<br />
&#8220;C:\Users\Public\Documents\<wbr />Olmonitor&#8221;<br />
&#8220;C:\Users\{username}\Documents\<wbr />SmarTerm\Sessions&#8221;</div>
<div>Some older versions of Smarterm would put it in the Program Files directory:<br />
&#8220;C:\Program Files\Esker\SmarTerm\Common\<wbr />Sessions&#8221;</div>
<div>OlMonitor will attempt to change the Session folder location to be the OlMonitor folder in Public Docs, but it&#8217;s often not allowed to make the change.</div>
<div><b>Easy way to be certain which folder Smarterm uses:</b></div>
<div>You can check the location of the Session folder by loading up Smarterm:</div>
<p>And clicking Properties-Global options:</p>
<p><a href="https://synapsonic.com/wp-content/uploads/2016/11/image.png"><img fetchpriority="high" decoding="async" class="size-full wp-image-604 alignnone" src="https://synapsonic.com/wp-content/uploads/2016/11/image.png" alt="" width="289" height="267" /></a></p>
</div>
<p>Then select &#8220;Sessions&#8221; under File Locations:</p>
<div>
<p><a href="https://synapsonic.com/wp-content/uploads/2016/11/Sessions.jpg"><img decoding="async" class="size-full wp-image-605 alignnone" src="https://synapsonic.com/wp-content/uploads/2016/11/Sessions.jpg" alt="" width="412" height="255" srcset="https://synapsonic.com/wp-content/uploads/2016/11/Sessions.jpg 412w, https://synapsonic.com/wp-content/uploads/2016/11/Sessions-300x186.jpg 300w" sizes="(max-width: 412px) 100vw, 412px" /></a></p>
</div>
<div>
<p>While you&#8217;re at it you might check that Ol Monitor has access to the Macros folder as well.  Ol Monitor does not even use this folder but it will check there to make sure there is a default macro file.  When Smarterm cannot locate the default macro file it gives an error which can prevent Ol Monitor from continuing.  So, to avoid the error, Ol Monitor will attempt to write a default macro file to that folder if it cannot find one there already</p>
</div>
<div><b>Precompiled files:</b>.</div>
<div><u>Only during installation, </u>Ol Monitor will need to write it&#8217;s Smarterm macro files directly to the Smarterm exe folder in Program Files:</div>
<div>Normally this is:<br />
&#8220;C:\Program Files (x86)\Esker\SmarTerm&#8221;</div>
<div>Ol Monitor does check the precompiled files in this folder to make sure they are present and the right version.  If Ol Monitor cannot access the folder you may get some error messages but it should go ahead and work fine.</div>
<div>More info on precompiled files:</div>
<div><a href="http://olmonitor.com/Home/Precompiled">http://olmonitor.com/Home/Precompiled</a></div>
<div>Finally there are options to have Ol Monitor encrypt all the files it uses.  More info on that:</div>
<div><a href="http://olmonitor.com/ManualM/module_15.htm">http://olmonitor.com/ManualM/module_15.htm</a></div>
<div></div>
<div></div>
]]></content:encoded>
					
					<wfw:commentRss>https://synapsonic.com/?feed=rss2&#038;p=569</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Fix for Smarterm macro error: &#8220;Error in line: Script is too large to be compiled&#8221;</title>
		<link>https://synapsonic.com/?p=527</link>
					<comments>https://synapsonic.com/?p=527#respond</comments>
		
		<dc:creator><![CDATA[ericains]]></dc:creator>
		<pubDate>Thu, 18 Apr 2013 15:27:43 +0000</pubDate>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Smarterm]]></category>
		<guid isPermaLink="false">http://synapsonic.com/?p=527</guid>

					<description><![CDATA[I had long been besieged by this error, and I know I can’t be the only one.  I could find nothing regarding this error in the manual, the help file, or even endless Googling.  Splitting your code out to multiple .stm macro files is the easy answer.  But that is problematic because passing variables to functions between macro files is iffy at best.  I don’t think it’s even possible without using precompiled files. I finally stumbled across this forum post....<p class="read-more"><a class="btn btn-default" href="https://synapsonic.com/?p=527"> Read More<span class="screen-reader-text">  Read More</span></a></p>]]></description>
										<content:encoded><![CDATA[<p>I had long been besieged by this error, and I know I can’t be the only one.  I could find nothing regarding this error in the manual, the help file, or even endless Googling.  Splitting your code out to multiple .stm macro files is the easy answer.  But that is problematic because passing variables to functions between macro files is iffy at best.  I don’t think it’s even possible without using precompiled files.</p>
<p>I finally stumbled across this forum post.<br />
<a href="http://www.pstnet.com/forum/Topic1767-5-1.aspx">http://www.pstnet.com/forum/Topic1767-5-1.aspx</a><br />
It was about some psychology software tool but apparently the same principle applies.<br />
That led me to this: <a href="http://www.pstnet.com/support/kb.asp?TopicID=1300">http://www.pstnet.com/support/kb.asp?TopicID=1300</a><br />
Remove string literals.  That’s it.  You may not remember what a string literal is, in your subs or functions, if you put some text within quotes: sName = “Beverly” that is a string literal.  I found that I use these all over the place.  When you record a macro and then look at the code it uses string literals.  The code samples in the macro guide are littered with literals.  So I’d always assumed that this was the proper way to do things.<br />
Anyway so what to do?  You can’t just remove these string literals they are essential.  One easy thing to do is replace anything you can with one of the built in constants.<br />
So instead of using “” use ebNullString.</p>
<pre class="brush:vb">Sub Test1()
    If x = "" Then
         Exit Sub
    End If

    'Change it to this:   
    If x = ebNullString Then     
         Exit Sub
    End If
End Sub</pre>
<p>I was able to do a search and replace and found that I’d used “” all over the place.</p>
<p>If you need even more space take it a step further, replace string literals with constants.</p>
<p>&#8216;For those string literals you create, make a constant instead:</p>
<pre class="brush:vb">Sub ChooseLoop()
     If sName = "West" Then
        Call WestLoop()
     Else
        Call EastLoop()
     End If
End Sub

'Outside the sub declare a constant instead:   
Const WEST = "West"

Sub ChooseLoop()
     If sName = WEST Then
        Call WestLoop()
     Else
        Call EastLoop()
     End If
End Sub</pre>
<p>By replacing just a couple of my commonly used string literals, I gained an extra 37 lines of compile space!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://synapsonic.com/?feed=rss2&#038;p=527</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Creating a mini calendar inside an excel spreadsheet</title>
		<link>https://synapsonic.com/?p=493</link>
					<comments>https://synapsonic.com/?p=493#respond</comments>
		
		<dc:creator><![CDATA[ericains]]></dc:creator>
		<pubDate>Sun, 27 May 2012 18:10:29 +0000</pubDate>
				<category><![CDATA[Macros]]></category>
		<guid isPermaLink="false">http://synapsonic.com/?p=493</guid>

					<description><![CDATA[Whilst creating various turn-around-time reports, I thought it would be helpful to add a little calendar to the spreadsheet.  Here is an excel vba function that adds a mini calendar to the cell address you specify: Public Function MakeCalendar(intStartRow As Integer, intStartCol As Integer, strStartDate As String, strEnddate As String) As Boolean 'Takes start row and column and prints a calendar. By Eric Ainsworth - www.synapsonic.com On Error GoTo Errorhandler Dim WeekDays() As String 'little array for S-Sat WeekDays =...<p class="read-more"><a class="btn btn-default" href="https://synapsonic.com/?p=493"> Read More<span class="screen-reader-text">  Read More</span></a></p>]]></description>
										<content:encoded><![CDATA[<p>Whilst creating various turn-around-time reports, I thought it would be helpful to add a little calendar to the spreadsheet.  Here is an excel vba function that adds a mini calendar to the cell address you specify:</p>
<pre class="brush:vb"> Public Function MakeCalendar(intStartRow As Integer, intStartCol As Integer, strStartDate As String, strEnddate As String) As Boolean
    'Takes start row and column and prints a calendar. By Eric Ainsworth - www.synapsonic.com
    On Error GoTo Errorhandler
    Dim WeekDays() As String 'little array for S-Sat
    WeekDays = Split("Sun,Mon,Tue,Wed,Thu,Fri,Sat", ",")
    Dim intX As Integer
    Dim intY As Integer
    Dim intCals As Integer
    Dim strMonth As String
    Dim intRow As Integer
    Dim intDay As Integer
    Dim intMonths As Integer
    If Month(strStartDate) = Month(strEnddate) Then
        'Same month
        intMonths = 1
    Else
        ‘Only set up to handle 2 months here.
        intMonths = 2
    End If

    For intCals = 1 To intMonths 'just once if same month
        If intCals = 1 Then 'first month
            strMonth = Month(strStartDate)
        Else
            strMonth = Month(strEnddate)
        End If

        If intCals &gt; 1 Then 'move everythuing over to right
            intStartCol = intStartCol + 7
        End If

        For intY = LBound(WeekDays) To UBound(WeekDays)
            Cells(intStartRow + 1, intStartCol + intY).Value = WeekDays(intY)
            If intY = 3 Then 'put month
                If intCals = 1 Then
                    Cells(intStartRow, intStartCol + intY).Value = Format(strStartDate, "mmm")
                Else
                    Cells(intStartRow, intStartCol + intY).Value = Format(strEnddate, "mmm")
                End If 'end if intcals
            End If 'end if wed

            Range(Cells(intStartRow, intStartCol + intY), Cells(intStartRow + 1, intStartCol + intY)).Select
            Selection.HorizontalAlignment = xlCenter
            With Selection.Interior
                .Pattern = xlSolid
                .PatternColorIndex = xlAutomatic
                .ThemeColor = xlThemeColorDark1
                .TintAndShade = -0.149998474074526
                .PatternTintAndShade = 0
            End With
        Next intY 'next weekday

        intStartRow = intStartRow + 1

        intRow = 0
        For intX = 1 To 31 'day of month
            If Not IsDate(strMonth &amp; " " &amp; Format(CStr(intX), "00") &amp; " " &amp; Year(strStartDate)) Then
                Debug.Print "MakeCalendar: Last day of month " &amp; strMonth &amp; " was: " &amp; intX - 1
                'Debug.Print strMonth &amp; " " &amp; Format(CStr(intX), "00") &amp; " " &amp; Year(strStartDate) &amp; " not a date"
                Exit For
            End If

            intDay = Weekday(strMonth &amp; " " &amp; Format(CStr(intX), "00") &amp; " " &amp; Year(strStartDate)) 'as it is this will break over new years

            Cells(intStartRow + intRow + 1, intDay + intStartCol - 1).Value = intX
            Cells(intStartRow + intRow + 1, intDay + intStartCol - 1).HorizontalAlignment = xlCenter

            If DateDiff("d", strMonth &amp; " " &amp; Format(CStr(intX), "00") &amp; " " &amp; Year(strStartDate), strStartDate) = 0 Or DateDiff("d", strMonth &amp; " " &amp; Format(CStr(intX), "00") &amp; " " &amp; Year(strStartDate), strEnddate) = 0 Then
                Cells(intStartRow + intRow + 1, intDay + intStartCol - 1).Font.Bold = True
            End If

            'Columns(intDay + intStartCol - 1).EntireColumn.AutoFit 'cant do this it messes up stuff above

            Select Case intDay
                Case 1 'sunday
                    Cells(intStartRow + intRow + 1, intDay + intStartCol - 1).Borders(xlEdgeLeft).LineStyle = xlContinuous
                Case 2 'monday
                Case 3
                Case 4 'wed
                Case 5 'thur
                Case 6 'fri
                Case 7 'sat
                        Cells(intStartRow + intRow + 1, intDay + intStartCol - 1).Borders(xlEdgeRight).LineStyle = xlContinuous
                        intRow = intRow + 1
            End Select

        Next intX 'next day

        intStartRow = intStartRow - 1
    Next intCals 'next calendar

    Exit Function
Errorhandler:
    Debug.Print Err.Description &amp; " " &amp; Err.Number
    Resume Next
End Function</pre>
<p>&nbsp;</p>
<pre class="brush:vb"></pre>
<p>This is how you would call it:</p>
<p>&nbsp;</p>
<pre class="brush:vb">Public Sub Test()
    Debug.Print MakeCalendar(1, 1, "5/1/2012", "5/31/2012")
End Sub</pre>
<p><a href="https://synapsonic.com/wp-content/uploads/2012/05/minicalendar2.jpg"><img loading="lazy" decoding="async" class="alignleft size-full wp-image-519" title="minicalendar" src="https://synapsonic.com/wp-content/uploads/2012/05/minicalendar2.jpg" alt="" width="488" height="234" srcset="https://synapsonic.com/wp-content/uploads/2012/05/minicalendar2.jpg 488w, https://synapsonic.com/wp-content/uploads/2012/05/minicalendar2-300x143.jpg 300w" sizes="auto, (max-width: 488px) 100vw, 488px" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://synapsonic.com/?feed=rss2&#038;p=493</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Email archive</title>
		<link>https://synapsonic.com/?p=468</link>
					<comments>https://synapsonic.com/?p=468#respond</comments>
		
		<dc:creator><![CDATA[ericains]]></dc:creator>
		<pubDate>Sat, 29 May 2010 20:57:56 +0000</pubDate>
				<category><![CDATA[Info]]></category>
		<guid isPermaLink="false">http://synapsonic.com/?p=468</guid>

					<description><![CDATA[If you are new to this list, you may not have gotten these previous emails: 1. Website announcement &#8211; Joke Intro, 2. Jokes 2 3. You know your instrument is a piece of junk when&#8230; 4. Excel Macro tutorial online, minor OL Monitor updates 5. May 2010 Ol Monitor/DragInfo program updates &#38; new feature poll 6. On OL Monitor &#8216;not working&#8217; with 6.4. 7. OL Monitor Budget n Bugfixes 8. Testers needed for pending log module 9. Pending log module...<p class="read-more"><a class="btn btn-default" href="https://synapsonic.com/?p=468"> Read More<span class="screen-reader-text">  Read More</span></a></p>]]></description>
										<content:encoded><![CDATA[<p>If you are new to this list, you may not have gotten these previous emails:<br />
1. <a href="http://eepurl.com/z6lB">Website announcement &#8211; Joke Intro, </a><br />
2. <a href="http://eepurl.com/ezBh">Jokes 2</a><br />
3. <a href="http://eepurl.com/eOXp">You know your instrument is a piece of junk when&#8230;</a><br />
4. <a href="http://eepurl.com/hc6j">Excel Macro tutorial online, minor OL Monitor updates</a><br />
5. <a href="http://eepurl.com/whof">May 2010 Ol Monitor/DragInfo program updates &amp; new feature poll</a><br />
6. <a href="http://eepurl.com/yRaP">On OL Monitor &#8216;not working&#8217; with 6.4.</a><br />
7. <a href="http://eepurl.com/ZjhE">OL Monitor Budget n Bugfixes</a><br />
8. <a href="http://us1.campaign-archive2.com/?u=2b1b01defc2a1b7e3212a7744&amp;id=8fcfac2bc9">Testers needed for pending log module</a><br />
9. <a href="http://us1.campaign-archive2.com/?u=2b1b01defc2a1b7e3212a7744&amp;id=d08194f20c">Pending log module ready</a><br />
10. <a href="http://eepurl.com/mbS9P">Windows 7, HRP, and new field.</a><br />
11. <a href="http://eepurl.com/xHbPX">2 new Ol Monitor-related programs available, more Windows 7 info, and HRP beta.</a><br />
12. <a href="http://eepurl.com/G3eJf">Ol Monitor HRP ready, CPL labs added, and some new features.</a><br />
13. <a href="http://eepurl.com/55JzH">OL Monitor Fall 2014 Newsletter &#8211; Ol Monitor HRP ready, CPL labs added, and some new features. </a><br />
14. <a href="http://eepurl.com/bj7yu9">Ol Monitor Spring 2015 &#8211; ADT Error log, HRP ONP (Orders not processed), PL module, and a powerpoint. </a> </p>
]]></content:encoded>
					
					<wfw:commentRss>https://synapsonic.com/?feed=rss2&#038;p=468</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>DragInfo Version 1.004 sync with text file</title>
		<link>https://synapsonic.com/?p=447</link>
					<comments>https://synapsonic.com/?p=447#respond</comments>
		
		<dc:creator><![CDATA[ericains]]></dc:creator>
		<pubDate>Fri, 30 Apr 2010 19:43:48 +0000</pubDate>
				<category><![CDATA[DragInfo]]></category>
		<category><![CDATA[snippets]]></category>
		<category><![CDATA[sync]]></category>
		<guid isPermaLink="false">http://synapsonic.com/?p=447</guid>

					<description><![CDATA[Synchronizing with text file: DragInfo now supports synchronizing with a plaintext file.  Changes to the xml file will update the plaintext file and vice versa. Any snippets that exist in the xml file already or that you create will also be created within the text file. On the other hand, DragInfo ignores any info in the text file that does not match a tab title. Lets say you have you have a tab named &#8220;Dog&#8221;.  If a line is detected...<p class="read-more"><a class="btn btn-default" href="https://synapsonic.com/?p=447"> Read More<span class="screen-reader-text">  Read More</span></a></p>]]></description>
										<content:encoded><![CDATA[<h4>Synchronizing with text file:</h4>
<p>DragInfo now supports synchronizing with a plaintext file.  Changes to the xml file will update the plaintext file and vice versa.<br />
Any snippets that exist in the xml file already or that you create will also be created within the text file.<br />
On the other hand, DragInfo ignores any info in the text file that does not match a tab title.<br />
Lets say you have you have a tab named &#8220;Dog&#8221;.  If a line is detected in the plaintext file with the word &#8220;Dog&#8221; (no other words on same line), the info below it will be treated as the snippet info.  The program knows the snippet for &#8220;Dog&#8221; ends when it sees more than 2 blank lines, the end of the file, or the name of another tab.<br />
<span id="more-447"></span>This program was written to store and easily drop test kit lot numbers and expirations that change frequently.<br />
In our lab some prefer using the simple plaintext file and others like the new way.  So the plaintext sync options ensures that if one tech updates the lot numbers in either the program or the text file, those changes will by synced.  This way we don&#8217;t have to change the info in two places every time we switch kit lots.<br />
The plaintext option is also a great way to have your info backed up in a simple format.</p>
<h4>Periodic file change checks:</h4>
<p>Both the text file and the xml file are checked every minute to see if they&#8217;ve been updated.<br />
If they have, DragInfo will notify you.  This is useful if several instances of the program on different pc’s are sharing the same file.</p>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://synapsonic.com/?feed=rss2&#038;p=447</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to combine/copy multiple workbooks into one workbook.</title>
		<link>https://synapsonic.com/?p=439</link>
					<comments>https://synapsonic.com/?p=439#respond</comments>
		
		<dc:creator><![CDATA[ericains]]></dc:creator>
		<pubDate>Fri, 30 Apr 2010 18:12:41 +0000</pubDate>
				<category><![CDATA[Macros]]></category>
		<category><![CDATA[multiple workbooks]]></category>
		<category><![CDATA[vba quicksort]]></category>
		<guid isPermaLink="false">http://synapsonic.com/?p=439</guid>

					<description><![CDATA[A lab billing macro example Here is another useful macro for copying data from multiple workbooks into one workbook. At the end of the month billing needs a report with all the months charges listed. We have been creating a workbook daily with the day&#8217;s charges listed. Now we have to collate all those workbooks into one workbook. Again it&#8217;s a tedious process in need of automation. To work this macro needs a sheet to copy to. I take the...<p class="read-more"><a class="btn btn-default" href="https://synapsonic.com/?p=439"> Read More<span class="screen-reader-text">  Read More</span></a></p>]]></description>
										<content:encoded><![CDATA[<h4>A lab billing macro example</h4>
<p>Here is another useful macro for copying data from multiple workbooks into one workbook. At the end of the month billing needs a report with all the months charges listed. We have been creating a workbook daily with the day&#8217;s charges listed. Now we have to collate all those workbooks into one workbook. Again it&#8217;s a tedious process in need of automation.</p>
<p><span id="more-439"></span>To work this macro needs a sheet to copy to. I take the easy road and create a workbook name MasterWorkbook. I run the macro and it copies all the month&#8217;s workbooks to the MasterWorkbook. Then I save MasterWorkbook with a new name denoting the month. this way the original remains blank for next month. To work all the workbooks/sheets need to be in one folder. It copies all data from all workbooks in that folder to one.</p>
<h4>How to get a list of workbooks in a folder:</h4>
<p>We have gathered all the month&#8217;s files in one folder. The first step is to get a list of all the excel workbooks in this folder.</p>
<pre class="brush:vb">Sub AggregateReports()
    'Get a folder full of reports and put them all into one sheet.
    'Get the folder from user.
    On Error GoTo ErrorHandler

    Dim fldr As FileDialog
    Dim strFolder As String
    Set fldr = Application.FileDialog(msoFileDialogFolderPicker)
    With fldr
        .Title = "Select the Folder where all the daily reports reside"
        .AllowMultiSelect = False
        .InitialFileName = strPath
        If .Show &lt;&gt; 0 Then
            strFolder = .SelectedItems(1)
        Else 'Cancelled
            strFolder = ""
        End If
    End With

    Debug.Print "Folder was: " &amp; strFolder
    Application.ScreenUpdating = False</pre>
<p>We have the folder name now we need to get a list of only the excel files within that folder. We do this with the old Dir command. If you recall in MS-Dos dir used to list all the files in a folder. It&#8217;s almost the same in vba, except Dir returns the name of the first file and must be called again to get the next.</p>
<pre class="brush:vb">    'Get all filenames within folder.
    Dim Files() As String
    ReDim Files(-1 To -1)
    ThisWB = ThisWorkbook.Name
    Filename = Dir(strFolder &amp; "\*.xls", vbNormal)
    Do Until Filename = ""
        If Filename &lt;&gt; ThisWB Then
            If UBound(Files) = -1 Then
                ReDim Files(0 To 0)
                If Filename = "" Then
                Else
                    Files(0) = Filename
                End If
            Else
                ReDim Preserve Files(0 To UBound(Files) + 1)
                Files(UBound(Files)) = Filename
            End If

            Debug.Print "Added: " &amp; Filename
        Else
            Debug.Print "Excluded this workbook: " &amp; Filename
        End If
        Filename = Dir()
    Loop</pre>
<p>We now have a list of files but sadly they are in no particular order. A simple sort of the files will ensure that when we loop through them (as long as you have named them all in the same format with a date) the days will get copied in order.</p>
<h4>How to do a quick sort in excel vba:</h4>
<pre class="brush:vb">Private Sub QuickSort(strArray() As String, intBottom As Integer, intTop As Integer)
    Dim strPivot As String, strTemp As String
    Dim intBottomTemp As Integer, intTopTemp As Integer

    intBottomTemp = intBottom
    intTopTemp = intTop

    strPivot = strArray((intBottom + intTop) \ 2)

    While (intBottomTemp &lt;= intTopTemp)

        'comparison of the values is a descending sort
        While (strArray(intBottomTemp) &lt; strPivot And intBottomTemp &lt; intTop)
            intBottomTemp = intBottomTemp + 1
        Wend

        While (strPivot &lt; strArray(intTopTemp) And intTopTemp &gt; intBottom)
            intTopTemp = intTopTemp - 1
        Wend

        If intBottomTemp &lt; intTopTemp Then
            strTemp = strArray(intBottomTemp)
            strArray(intBottomTemp) = strArray(intTopTemp)
            strArray(intTopTemp) = strTemp
        End If

        If intBottomTemp &lt;= intTopTemp Then
            intBottomTemp = intBottomTemp + 1
            intTopTemp = intTopTemp - 1
        End If

    Wend

    'the function calls itself until everything is in good order
    If (intBottom &lt; intTopTemp) Then QuickSort strArray, intBottom, intTopTemp
    If (intBottomTemp &lt; intTop) Then QuickSort strArray, intBottomTemp, intTop

End Sub</pre>
<p>This is a great and simple quicksort function but how do we use it? It&#8217;s simple:</p>
<pre class="brush:vb">    'NOTE: We are still in sub AggregateReports here:
    'Files come in all willy nilly, sort them by date
    QuickSort Files, LBound(Files), UBound(Files)

    Dim intX As Integer
    For intX = LBound(Files) To UBound(Files)
        Debug.Print "After Sort: " &amp; Files(intX)
    Next intX</pre>
<p>Now we have our list of files we just need to loop through it and copy them to the MasterWorkbook:</p>
<pre class="brush:vb">    'NOTE: we are still in sub AggregateReports here:
    Dim wkb As Workbook
    Dim intFinalRow As Integer
    Dim intRow As Integer
    Dim blnHeaderDone As Boolean

    For intX = LBound(Files) To UBound(Files)
            Set wkb = Workbooks.Open(Filename:=strFolder &amp; "\" &amp; Files(intX))
            wkb.Activate
            With wkb.Sheets(1)
                Set LastCell = .Cells.SpecialCells(xlCellTypeLastCell)
                .Activate
                intFinalRow = Range("A65536").End(xlUp).Row  '
                For intRow = 2 To intFinalRow
                    If blnHeaderDone = False Then
                        'We only want to copy the header row once so we do it here and set variable to True
                        Rows(intRow - 1).EntireRow.Copy (Sheets(1).Range("a65536").End(xlUp).Offset(0, 0))
                        blnHeaderDone = True
                    End If
                    Rows(intRow).EntireRow.Copy (Sheets(1).Range("a65536").End(xlUp).Offset(1, 0))
                    If intRow = 2 Then 'This add's a 'Begin' comment to the first cell of that day.
                        Sheets(1).Range("a65536").End(xlUp).Offset(0, 7).AddComment ("Day " &amp; CStr(intX) &amp; " Begin: " &amp; Files(intX))
                    End If
                    If intRow = intFinalRow Then 'Add end
                        Sheets(1).Range("a65536").End(xlUp).Offset(0, 7).AddComment ("Day " &amp; CStr(intX) &amp; " End: " &amp; Files(intX))
                    End If

                Next intRow

            End With
            wkb.Close False

    Next intX 'next file.
    Application.ScreenUpdating = True

    Exit Sub
ErrorHandler:
    Debug.Print Err.Number &amp; " " &amp; Err.Description &amp; " " &amp; Erl
    MsgBox Err.Number &amp; " " &amp; Err.Description &amp; " " &amp; Erl
End Sub</pre>
<p>And voila! Another 30 minutes saved!</p>
<p>You can download the workbook with macro here: <a href="http://www.synapsonic.com/Files/MasterWorkbook.zip">MasterWorkbook</a></p>
<p>[ad name=&#8221;Synap blog wide&#8221;]</p>
]]></content:encoded>
					
					<wfw:commentRss>https://synapsonic.com/?feed=rss2&#038;p=439</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Turn-Around-Time Excel macro</title>
		<link>https://synapsonic.com/?p=406</link>
					<comments>https://synapsonic.com/?p=406#respond</comments>
		
		<dc:creator><![CDATA[ericains]]></dc:creator>
		<pubDate>Fri, 02 Apr 2010 15:23:10 +0000</pubDate>
				<category><![CDATA[Macros]]></category>
		<category><![CDATA[Average Time]]></category>
		<category><![CDATA[DateDiff]]></category>
		<category><![CDATA[Excel]]></category>
		<guid isPermaLink="false">http://synapsonic.com/?p=406</guid>

					<description><![CDATA[Once again we have reports that the system has chucked out that need a lot of work.  In this example we are reporting the turn-around-times for a monthly report.  In this example, the Cerner Powervision app gives us a report on each tests’ TAT.  This report is exported to Excel and the user counts how many tests exceeded TAT, and calculates the percent meeting target TAT. TEDIOUS!  Excel macros to the rescue: Instead of making this into a full-blown tutorial...<p class="read-more"><a class="btn btn-default" href="https://synapsonic.com/?p=406"> Read More<span class="screen-reader-text">  Read More</span></a></p>]]></description>
										<content:encoded><![CDATA[<p>Once again we have reports that the system has chucked out that need a lot of work.  In this example we are reporting the turn-around-times for a monthly report.  In this example, the Cerner Powervision app gives us a report on each tests’ TAT.  This report is exported to Excel and the user counts how many tests exceeded TAT, and calculates the percent meeting target TAT. TEDIOUS!  Excel macros to the rescue:</p>
<p>Instead of making this into a full-blown tutorial I will just list the sticking points and post the macro.  If you have any questions just add a comment.</p>
<h4>What to do when you can’t use Personal.xlsb to store your macros: (only for people using Personal.xlsb otherwise skip this)</h4>
<p>The Powervision app exports the reports to Excel, but it’s not loading my Personal macros file.  This is because it’s running a Citrix Excel (I’m guessing) instead of using my pc’s excel.  For this you just have to put your macro code into a workbook, and then load that workbook with the Citrix excel along with the exported report.  Your macro code can still do everything it needs to, having Personal macros is just a convenience.  I have named my workbook “ProcessTATexportsMacroXl2003.xls”. It doesn&#8217;t actually have or import any data, it just contains my macro code.</p>
<p>The app exports each report to a separate workbook, this leads to another problem:</p>
<p><span id="more-406"></span></p>
<h4>How to access sheets from a different workbook:</h4>
<p>This isn’t really a problem but most are used to working at the sheet level in Excel. You just have to step back to the Workbook level.  Here’s how:</p>
<p>Each workbook that is loaded in Excel is given an index number. So we just cycle through the numbers:</p>
<pre class="brush:vb">    Dim intBook As Integer
    
    For intBook = 1 To Application.Workbooks.Count
        With Workbooks(intBook).Sheets(1)
 	 'Do whatever you need to do with sheet here
        End With
    Next intBook</pre>
<p>&nbsp;</p>
<p>Great. Next problem, the report gives the times in a DAYS HOURS:MINUTES format like this 0 00:00</p>
<p>That leading 0 is going to be troublesome. We can just cut it off. (If you wanted to be super careful you could make sure it&#8217;s not 0 and if not add it to your calculation).</p>
<pre class="brush:vb">Right(Cells(intRow, 6).Text, 5</pre>
<p>&nbsp;</p>
<p>Next problem, we have a list of times in Excel and we need to get the average time. The Excel AVERAGE function doesn&#8217;t work. We can use the datediff function to give us total minutes instead of hours and minutes.</p>
<h4>How to calculate elapsed time when given hours:minutes in Excel:</h4>
<p>This is also</p>
<h4>how to calculate an average time from a list of times.</h4>
<pre class="brush:vb">        Dim intFinalRow As Integer
        intFinalRow = Range("A65536").End(xlUp).Row

        For intRow = 1 To intFinalRow

                'intTime = CInt(Trim(Replace(Replace(Cells(intRow, 6).Value, ":", ""), " ", "")))  'WRONG!
                'This seems like it would work, just replace out all the colons and commas and get to the raw value, BUT
                'if the time is over an hour you get 1:15 which results in: 115.  Do it the right way and treat it as a date
                'you will get the correct number of minutes: 75
                strTime = DateDiff("n", 0, Right(Cells(intRow, 6).Text, 5))
                
                'Add a cell next to it with the tat time in minutes.
                Cells(intRow, 7).Value = strTime

        Next intRow

    'Now the Excel average function will work with our list of times since they are a whole number in minutes.
    Cells(intFinalRow + 1, 7).FormulaR1C1 = "=AVERAGE(R[-" &amp; intFinalRow - 2 &amp; "]C:R[-1]C)"</pre>
<p>The last problem we run into is that one of the sheets contains TAT&#8217;s from both PT&#8217;s and aPTT&#8217;s, so we can&#8217;t just loop through the whole thing like the others. To solve this I added some checking and saved the beginning and ending row of each set. To see this and the entire working example code download the example file below.</p>
<p><a href="https://synapsonic.com/Files/ProcessTATExample.zip">ProcessTATExample.zip</a></p>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://synapsonic.com/?feed=rss2&#038;p=406</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Excel Macro Tutorial 6 &#8211; Add macro buttons to your toolbar</title>
		<link>https://synapsonic.com/?p=357</link>
					<comments>https://synapsonic.com/?p=357#comments</comments>
		
		<dc:creator><![CDATA[ericains]]></dc:creator>
		<pubDate>Sat, 23 Jan 2010 17:19:45 +0000</pubDate>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Custom excel buttons]]></category>
		<category><![CDATA[personal.xlsb]]></category>
		<guid isPermaLink="false">http://synapsonic.com/?p=357</guid>

					<description><![CDATA[The finishing touch will be to put your macros into the toolbar, so they will be available to you every time you open up excel. I have been working with Excel 2007 in these tutorials but up to this point everything I have shown you will work with 2003 and most other versions.  With 2007 Microsoft removed the ability to (without tricky tweaking) make a custom drop-down menu in Excel.  But they did make it easy to add a custom...<p class="read-more"><a class="btn btn-default" href="https://synapsonic.com/?p=357"> Read More<span class="screen-reader-text">  Read More</span></a></p>]]></description>
										<content:encoded><![CDATA[<p>The finishing touch will be to put your macros into the toolbar, so they will be available to you every time you open up excel.<br />
I have been working with Excel 2007 in these tutorials but up to this point everything I have shown you will work with 2003 and most other versions.  With 2007 Microsoft removed the ability to (without tricky tweaking) make a custom drop-down menu in Excel.  But they did make it easy to add a custom button to the quick access bar for a single macro.  For a great tutorial on adding custom menus to 2003 see this page: <a href="http://peltiertech.com/WordPress/how-to-assign-a-macro-to-a-toolbar-or-menu/" target="_blank" rel="noopener">Assign a Macro to a Toolbar or Menu</a>.  For 2007 see my tutorial below.</p>
<h3>Adding a custom macro button to the Excel 2007 quick access toolbar:</h3>
<p>The first thing to do is make sure you’ve been putting your macro code in the right place.  If you put the code in the workbook it will be available to anyone who opens that file.  But in this example we open and process a new workbook every day.  So we should put the code in our personal macro file.  This makes it available to you every time you open Excel.  Open the visual basic editor to look at your files: <span id="more-357"></span><br />
<a href="https://synapsonic.com/wp-content/uploads/2010/01/billreportpersonalxlsb.jpg"><img loading="lazy" decoding="async" style="display: inline; margin-left: 0px; margin-right: 0px; border-width: 0px;" title="bill report personal xlsb" src="https://synapsonic.com/wp-content/uploads/2010/01/billreportpersonalxlsb_thumb.jpg" alt="bill report personal xlsb" width="415" height="484" border="0" /></a>  If you have been putting your code in a workbook, or someone shared a workbook with you with macros in it, you can simply copy and paste the code into ‘Module1’ of your PERSONAL.XLSB file.<br />
(Note: Don’t have a PERSONAL.XLSB?  Here are instructions on creating one: <a href="http://www.rondebruin.nl/personal.htm" target="_blank" rel="noopener">How to create a Personal.xlsb</a> )</p>
<p>After making sure the code is in personal.xlsb, it is easy to add quick access buttons to your macros.<br />
Click on the down arrow button on your quick access toolbar:<br />
<a href="https://synapsonic.com/wp-content/uploads/2010/01/billreportmorecommands.jpg"><img loading="lazy" decoding="async" style="display: inline; border-width: 0px;" title="bill report more commands" src="https://synapsonic.com/wp-content/uploads/2010/01/billreportmorecommands_thumb.jpg" alt="bill report more commands" width="134" height="244" border="0" /></a><br />
Click ‘More Commands…’<br />
From the ‘Choose commands from’ drop-down select ‘Macros’<br />
<a href="https://synapsonic.com/wp-content/uploads/2010/01/billreportchoosecommands.jpg"><img loading="lazy" decoding="async" style="display: inline; border-width: 0px;" title="bill report choose commands" src="https://synapsonic.com/wp-content/uploads/2010/01/billreportchoosecommands_thumb.jpg" alt="bill report choose commands" width="644" height="280" border="0" /></a><br />
All of the macros in your Personal.xlsb file should be listed:<br />
<a href="https://synapsonic.com/wp-content/uploads/2010/01/billreportmacros.jpg"><img loading="lazy" decoding="async" style="display: inline; border-width: 0px;" title="bill report macros" src="https://synapsonic.com/wp-content/uploads/2010/01/billreportmacros_thumb.jpg" alt="bill report macros" width="244" height="132" border="0" /></a><br />
Now you can simply click each one and add it to your toolbar.<br />
The toolbar ends up looking something like this:<br />
<a href="https://synapsonic.com/wp-content/uploads/2010/01/billreportundonetoolbar.jpg"><img loading="lazy" decoding="async" style="display: inline; border-width: 0px;" title="bill report undone toolbar" src="https://synapsonic.com/wp-content/uploads/2010/01/billreportundonetoolbar_thumb.jpg" alt="bill report undone toolbar" width="644" height="57" border="0" /></a><br />
Go back to the quick access options by clicking ‘More Commands’ again.  You can change the icon for any item by selecting it and clicking the ‘Modify’ button.  Here is how my toolbar looked after modifying:<br />
<a href="https://synapsonic.com/wp-content/uploads/2010/01/billreportaftertoolbar.jpg"><img loading="lazy" decoding="async" style="display: inline; border-width: 0px;" title="bill report after toolbar" src="https://synapsonic.com/wp-content/uploads/2010/01/billreportaftertoolbar_thumb.jpg" alt="bill report after toolbar" width="644" height="52" border="0" /></a></p>
<p>Well that’s it!  Now a task that took 5-10 minutes per report can be done in about 30 seconds.  What will you do with all your extra time?</p>
<p>&nbsp;</p>
<p>Can you think of any improvements for this set of macros?</p>
<p><a href="https://synapsonic.com/?p=290">Back to tutorial 1</a></p>
<h3>Download all the macros covered in this tutorial:</h3>
<p>Here is my Personal.xlsb file containing a slightly improved version of all the macros in this tutorial: <a href="https://synapsonic.com/Files/PERSONAL.XLSB">PERSONAL.XLSB</a></p>
<p>Here is an excel workbook with fake patients you can test the macros out on: <a href="https://synapsonic.com/Files/FakeBillingReport.xlsx">FakeBillingReport.xlsx</a></p>
<p>Here is a macro-enabled excel workbook with the code in the workbook: <a href="https://synapsonic.com/Files/FakeBillingReport.xlsm">FakeBillingReport.xlsm (macros inside)</a> (in case you had trouble getting to the macros in PERSONAL.xlsb).</p>
]]></content:encoded>
					
					<wfw:commentRss>https://synapsonic.com/?feed=rss2&#038;p=357</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
