<?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>C L Snyder &#187; Excel</title>
	<atom:link href="http://www.clsnyder.com/WordPress/category/computer/excel/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.clsnyder.com/WordPress</link>
	<description>Kaizen with Sprezzatura</description>
	<lastBuildDate>Mon, 06 Feb 2012 22:52:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Excel code to analyze ACSPBLS Data</title>
		<link>http://www.clsnyder.com/WordPress/2009/07/08/excel-code-to-analyze-acspbls-data/</link>
		<comments>http://www.clsnyder.com/WordPress/2009/07/08/excel-code-to-analyze-acspbls-data/#comments</comments>
		<pubDate>Thu, 09 Jul 2009 03:22:33 +0000</pubDate>
		<dc:creator>clsnyder</dc:creator>
				<category><![CDATA[Excel]]></category>

		<guid isPermaLink="false">http://www.clsnyder.com/WordPress/?p=540</guid>
		<description><![CDATA[Import from the ACSPBLS Site * Introduction Many pediatric surgeons are now storing or will soon be storing a record of their operative cases on the American College of Surgeons Database, located here It is useful to be able to &#8230; <a href="http://www.clsnyder.com/WordPress/2009/07/08/excel-code-to-analyze-acspbls-data/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Import from the ACSPBLS Site</p>
<p>* Introduction<br />
Many pediatric surgeons are now storing or will soon be storing a record of their operative cases on the American College of Surgeons Database, located <a href="https://acspbls.resiliencesoftware.com/">here </a></p>
<p>It is useful to be able to analyze your own data, for volume, RVU&#8217;s over time, etc. This brief tutorial will show you how to download your stored data, run a single macro on MS Excel 2007 (It should work on Excel 2003), and create a graphic of the result.</p>
<p>* Description<br />
1. Go to the site and sign in<br />
2. On the main page, select Cases > Export<br />
3. A new page will open. Select &#8220;All Dates&#8221;, and &#8220;Exclude ICD/CPT Descriptions&#8221;<br />
4. Hit &#8220;Submit&#8221;<br />
5. Save the resultant CSV (=comma separated values) file as &#8220;cases-dump.csv&#8221;, where you can find it<br />
6. Download <a href="http://clsnyder.com/excel/rvu.xls">this  </a> file of RVU&#8217;s for each CPT code<br />
7. Open MS Excel and open this file; rename the worksheet tab the data is on as &#8220;rvu&#8221;<br />
8. Save the file as a &#8220;Macro-enabled&#8221; Workbook<br />
9. Click the circular windows icon in the left upper corner of the worksheet &#8211; there is a vertical menu &#8220;New&#8221;, &#8220;Open&#8221;, &#8220;Save&#8221;, etc; at the bottom are two rectangular buttons &#8211; click on &#8220;Excel Options&#8221;<br />
10. Select &#8220;Popular&#8221; if not already open, and pick the &#8220;Show developer tab in the ribbon&#8221;; click OK<br />
11. Now click on the new Developer tabbed menu at the top right<br />
12. Click on the Macro button<br />
13. Type in &#8220;import&#8221; in the name box, and click &#8220;create&#8221;<br />
14. A new Visual basic window will open, with this filled in:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #E56717; font-weight: bold;">Sub</span> import()
&nbsp;
<span style="color: #8D38C9; font-weight: bold;">End</span> <span style="color: #E56717; font-weight: bold;">Sub</span></pre></td></tr></table></div>

<p>15. Delete this and past in the code from here:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
</pre></td><td class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #E56717; font-weight: bold;">Sub</span> import()
	<span style="color: #008000;">'imports from the
</span>	<span style="color: #151B8D; font-weight: bold;">Dim</span> LastRow <span style="color: #151B8D; font-weight: bold;">As</span> <span style="color: #F660AB; font-weight: bold;">Long</span>
    <span style="color: #151B8D; font-weight: bold;">Dim</span> LastColumn <span style="color: #151B8D; font-weight: bold;">As</span> <span style="color: #F660AB; font-weight: bold;">Long</span>
    <span style="color: #151B8D; font-weight: bold;">Dim</span> FName <span style="color: #151B8D; font-weight: bold;">As</span> <span style="color: #F660AB; font-weight: bold;">Variant</span>
&nbsp;
    <span style="color: #008000;">'Query for the file to open
</span>    FName = Application.GetOpenFilename()
    <span style="color: #8D38C9; font-weight: bold;">If</span> FName = <span style="color: #00C2FF; font-weight: bold;">False</span> <span style="color: #8D38C9; font-weight: bold;">Then</span>
        MsgBox <span style="color: #800000;">&quot;You didn't choose a file&quot;</span>
    <span style="color: #8D38C9; font-weight: bold;">Else</span>
        <span style="color: #008000;">'MsgBox FName
</span>    <span style="color: #8D38C9; font-weight: bold;">End</span> <span style="color: #8D38C9; font-weight: bold;">If</span>
&nbsp;
    <span style="color: #008000;">'Add a new sheet and import the csv data
</span>    Sheets.Add
    ActiveSheet.Name = <span style="color: #800000;">&quot;cases-dump&quot;</span>
    Range(<span style="color: #800000;">&quot;A1&quot;</span>).<span style="color: #8D38C9; font-weight: bold;">Select</span>
    <span style="color: #8D38C9; font-weight: bold;">With</span> ActiveSheet.QueryTables.Add(Connection:= _
        <span style="color: #800000;">&quot;TEXT;&quot;</span> &amp; FName, _
        Destination:=Range(<span style="color: #800000;">&quot;$A$1&quot;</span>))
        .Name = <span style="color: #800000;">&quot;cases-dump&quot;</span>
        .FieldNames = <span style="color: #00C2FF; font-weight: bold;">True</span>
        .RowNumbers = <span style="color: #00C2FF; font-weight: bold;">False</span>
        .FillAdjacentFormulas = <span style="color: #00C2FF; font-weight: bold;">False</span>
        .PreserveFormatting = <span style="color: #00C2FF; font-weight: bold;">True</span>
        .RefreshOnFileOpen = <span style="color: #00C2FF; font-weight: bold;">False</span>
        .RefreshStyle = xlInsertDeleteCells
        .SavePassword = <span style="color: #00C2FF; font-weight: bold;">False</span>
        .SaveData = <span style="color: #00C2FF; font-weight: bold;">True</span>
        .AdjustColumnWidth = <span style="color: #00C2FF; font-weight: bold;">True</span>
        .RefreshPeriod = 0
        .TextFilePromptOnRefresh = <span style="color: #00C2FF; font-weight: bold;">False</span>
        .TextFilePlatform = 437
        .TextFileStartRow = 1
        .TextFileParseType = xlDelimited
        .TextFileTextQualifier = xlTextQualifierDoubleQuote
        .TextFileConsecutiveDelimiter = <span style="color: #00C2FF; font-weight: bold;">False</span>
        .TextFileTabDelimiter = <span style="color: #00C2FF; font-weight: bold;">True</span>
        .TextFileSemicolonDelimiter = <span style="color: #00C2FF; font-weight: bold;">False</span>
        .TextFileCommaDelimiter = <span style="color: #00C2FF; font-weight: bold;">True</span>
        .TextFileSpaceDelimiter = <span style="color: #00C2FF; font-weight: bold;">False</span>
        .TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, _
        1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
        .TextFileTrailingMinusNumbers = <span style="color: #00C2FF; font-weight: bold;">True</span>
        .Refresh BackgroundQuery:=<span style="color: #00C2FF; font-weight: bold;">False</span>
    <span style="color: #8D38C9; font-weight: bold;">End</span> <span style="color: #8D38C9; font-weight: bold;">With</span>
&nbsp;
    <span style="color: #008000;">'Find the last Filled row of the range
</span>    <span style="color: #8D38C9; font-weight: bold;">If</span> WorksheetFunction.CountA(Cells) &gt; 0 <span style="color: #8D38C9; font-weight: bold;">Then</span>
        <span style="color: #008000;">'Search for any entry, by searching backwards by Rows.
</span>        LastRow = Cells.Find(What:=<span style="color: #800000;">&quot;*&quot;</span>, After:=[A1], SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
        MsgBox <span style="color: #800000;">&quot;Importing:  &quot;</span> &amp; LastRow &amp; <span style="color: #800000;">&quot;  Operations&quot;</span>
    <span style="color: #8D38C9; font-weight: bold;">End</span> <span style="color: #8D38C9; font-weight: bold;">If</span>
    Range(<span style="color: #800000;">&quot;A:D,F:F,G:G,H:I,K:M,O:P,V:AI,AO:AZ&quot;</span>).<span style="color: #8D38C9; font-weight: bold;">Select</span>
    Selection.delete Shift:=xlToLeft
    Columns(<span style="color: #800000;">&quot;A:A&quot;</span>).<span style="color: #8D38C9; font-weight: bold;">Select</span>
    Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
    Columns(<span style="color: #800000;">&quot;C:C&quot;</span>).<span style="color: #8D38C9; font-weight: bold;">Select</span>
    Selection.Cut
    Columns(<span style="color: #800000;">&quot;A:A&quot;</span>).<span style="color: #8D38C9; font-weight: bold;">Select</span>
    ActiveSheet.Paste
    Columns(<span style="color: #800000;">&quot;B:B&quot;</span>).EntireColumn.AutoFit
    Columns(<span style="color: #800000;">&quot;C:C&quot;</span>).<span style="color: #8D38C9; font-weight: bold;">Select</span>
    Selection.delete Shift:=xlToLeft
    Selection.Cut
    Columns(<span style="color: #800000;">&quot;N:N&quot;</span>).<span style="color: #8D38C9; font-weight: bold;">Select</span>
    ActiveSheet.Paste
    Columns(<span style="color: #800000;">&quot;C:C&quot;</span>).<span style="color: #8D38C9; font-weight: bold;">Select</span>
    Selection.delete Shift:=xlToLeft
    Range(<span style="color: #800000;">&quot;N1&quot;</span>).<span style="color: #8D38C9; font-weight: bold;">Select</span>
    ActiveCell.FormulaR1C1 = <span style="color: #800000;">&quot;rvu&quot;</span>
    Range(<span style="color: #800000;">&quot;N2&quot;</span>).<span style="color: #8D38C9; font-weight: bold;">Select</span>
    ActiveCell.FormulaR1C1 = <span style="color: #800000;">&quot;=VLOOKUP(RC[-6],rvu!R1C[-13]:R7240C[-12],2)&quot;</span>
    Range(<span style="color: #800000;">&quot;N2&quot;</span>).<span style="color: #8D38C9; font-weight: bold;">Select</span>
    Selection.AutoFill Destination:=Range(<span style="color: #800000;">&quot;N2:N&quot;</span> &amp; LastRow), <span style="color: #151B8D; font-weight: bold;">Type</span>:=xlFillDefault
	Columns(<span style="color: #800000;">&quot;N:N&quot;</span>).<span style="color: #8D38C9; font-weight: bold;">Select</span>
    Selection.Copy
    Columns(<span style="color: #800000;">&quot;O:O&quot;</span>).<span style="color: #8D38C9; font-weight: bold;">Select</span>
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=<span style="color: #00C2FF; font-weight: bold;">False</span>, Transpose:=<span style="color: #00C2FF; font-weight: bold;">False</span>
    Columns(<span style="color: #800000;">&quot;N:N&quot;</span>).<span style="color: #8D38C9; font-weight: bold;">Select</span>
    Application.CutCopyMode = <span style="color: #00C2FF; font-weight: bold;">False</span>
    Selection.delete Shift:=xlToLeft
    Selection.Replace What:=<span style="color: #800000;">&quot;#N/A&quot;</span>, Replacement:=<span style="color: #800000;">&quot;0&quot;</span>, LookAt:=xlPart, _
        SearchOrder:=xlByRows, MatchCase:=<span style="color: #00C2FF; font-weight: bold;">False</span>, SearchFormat:=<span style="color: #00C2FF; font-weight: bold;">False</span>, _
        ReplaceFormat:=<span style="color: #00C2FF; font-weight: bold;">False</span>
        Range(<span style="color: #800000;">&quot;A6&quot;</span>).<span style="color: #8D38C9; font-weight: bold;">Select</span>
    	LastRow = Cells.Find(What:=<span style="color: #800000;">&quot;*&quot;</span>, After:=[A1], SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
	LastColumn = Cells.Find(What:=<span style="color: #800000;">&quot;*&quot;</span>, After:=[A1], SearchOrder:=xlByColumns, SearchDirection:=xlPrevious).Column 
&nbsp;
    Sheets.Add.Name = <span style="color: #800000;">&quot;pivot&quot;</span>
    ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
        <span style="color: #800000;">&quot;cases-dump!R1C1:R&quot;</span> &amp; LastRow &amp; <span style="color: #800000;">&quot;C&quot;</span> &amp; LastColumn, Version:=xlPivotTableVersion12).CreatePivotTable _
        TableDestination:=<span style="color: #800000;">&quot;pivot!R3C1&quot;</span>, TableName:=<span style="color: #800000;">&quot;PivotTable1&quot;</span>, DefaultVersion _
        :=xlPivotTableVersion12
    Sheets(<span style="color: #800000;">&quot;pivot&quot;</span>).<span style="color: #8D38C9; font-weight: bold;">Select</span>
    Cells(3, 1).<span style="color: #8D38C9; font-weight: bold;">Select</span>
    <span style="color: #8D38C9; font-weight: bold;">With</span> ActiveSheet.PivotTables(<span style="color: #800000;">&quot;PivotTable1&quot;</span>).PivotFields(<span style="color: #800000;">&quot;Procedure Date&quot;</span>)
        .Orientation = xlRowField
        .Position = 1
    <span style="color: #8D38C9; font-weight: bold;">End</span> <span style="color: #8D38C9; font-weight: bold;">With</span>
    ActiveSheet.PivotTables(<span style="color: #800000;">&quot;PivotTable1&quot;</span>).AddDataField ActiveSheet.PivotTables( _
        <span style="color: #800000;">&quot;PivotTable1&quot;</span>).PivotFields(<span style="color: #800000;">&quot;rvu&quot;</span>), <span style="color: #800000;">&quot;Sum of rvu&quot;</span>, xlSum
    Range(<span style="color: #800000;">&quot;A6&quot;</span>).<span style="color: #8D38C9; font-weight: bold;">Select</span>
    Selection.Group Start:=<span style="color: #00C2FF; font-weight: bold;">True</span>, <span style="color: #8D38C9; font-weight: bold;">End</span>:=<span style="color: #00C2FF; font-weight: bold;">True</span>, Periods:=Array(<span style="color: #00C2FF; font-weight: bold;">False</span>, <span style="color: #00C2FF; font-weight: bold;">False</span>, <span style="color: #00C2FF; font-weight: bold;">False</span>, _
        <span style="color: #00C2FF; font-weight: bold;">False</span>, <span style="color: #00C2FF; font-weight: bold;">True</span>, <span style="color: #00C2FF; font-weight: bold;">False</span>, <span style="color: #00C2FF; font-weight: bold;">True</span>)
    <span style="color: #8D38C9; font-weight: bold;">With</span> ActiveSheet.PivotTables(<span style="color: #800000;">&quot;PivotTable1&quot;</span>).PivotFields(<span style="color: #800000;">&quot;Years&quot;</span>)
        .Orientation = xlColumnField
        .Position = 1
    <span style="color: #8D38C9; font-weight: bold;">End</span> <span style="color: #8D38C9; font-weight: bold;">With</span>
<span style="color: #8D38C9; font-weight: bold;">End</span> <span style="color: #E56717; font-weight: bold;">Sub</span></pre></td></tr></table></div>

<p>16. Save and Close the Visual basic window<br />
17. Click anywhere (single-click) in the rvu sheet<br />
18. Run the &#8220;import&#8221; macro from the Developer tab<br />
19. You should see this:</p>
<p><img src="http://www.clsnyder.com/WordPress/wp-content/uploads/2009/07/table_report.png" alt="table_report" width= "600" height="400" rel= "lightbox" title="table_report" class="alignleft size-full wp-image-545" /></p>
<p>20. You can click in the table and then select the &#8220;Options&#8221; tab, and a column graph to get this to get this (RVU&#8217;s generated by month and year):</p>
<p><img src="http://www.clsnyder.com/WordPress/wp-content/uploads/2009/07/Op-Data-July-2009.png" alt="Op Data July 2009"  width= "600" height="400" rel= "lightbox" title="Op Data July 2009" class="alignleft size-full wp-image-528" /></p>
<p>21. Good Luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.clsnyder.com/WordPress/2009/07/08/excel-code-to-analyze-acspbls-data/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

