﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-Jcat-随笔分类-VBA</title><link>http://www.blogjava.net/Jcat/category/30224.html</link><description>宠辱不惊，闲看庭前花开花落～～</description><language>zh-cn</language><lastBuildDate>Sat, 29 Aug 2009 21:29:26 GMT</lastBuildDate><pubDate>Sat, 29 Aug 2009 21:29:26 GMT</pubDate><ttl>60</ttl><item><title>小工具</title><link>http://www.blogjava.net/Jcat/archive/2009/05/20/271788.html</link><dc:creator>Jcat</dc:creator><author>Jcat</author><pubDate>Wed, 20 May 2009 12:20:00 GMT</pubDate><guid>http://www.blogjava.net/Jcat/archive/2009/05/20/271788.html</guid><wfw:comment>http://www.blogjava.net/Jcat/comments/271788.html</wfw:comment><comments>http://www.blogjava.net/Jcat/archive/2009/05/20/271788.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/Jcat/comments/commentRss/271788.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Jcat/services/trackbacks/271788.html</trackback:ping><description><![CDATA[
		<font color="#006400">运行该Sub，所有单元格的字母都会变成大写的</font>
		<br />
		<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;">
				<!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>-->
				<span style="color: rgb(0, 0, 255);">Sub</span>
				<span style="color: rgb(0, 0, 0);"> cap()<br /></span>
				<span style="color: rgb(0, 0, 255);">Dim</span>
				<span style="color: rgb(0, 0, 0);"> cell </span>
				<span style="color: rgb(0, 0, 255);">As</span>
				<span style="color: rgb(0, 0, 0);"> Range<br /></span>
				<span style="color: rgb(0, 0, 255);">For</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 255);">Each</span>
				<span style="color: rgb(0, 0, 0);"> cell In UsedRange<br />    cell.Value </span>
				<span style="color: rgb(0, 0, 0);">=</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 255);">UCase</span>
				<span style="color: rgb(0, 0, 0);">
						<font color="#0000ff">$</font>(cell.Value)<br /></span>
				<span style="color: rgb(0, 0, 255);">Next</span>
				<span style="color: rgb(0, 0, 0);">
						<br />
				</span>
				<span style="color: rgb(0, 0, 255);">End Sub</span>
		</div>
		<br />
		<font color="#006400">给定一段时间，计算出什么时候到期</font>
		<br />
		<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;">
				<!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>-->
				<span style="color: rgb(0, 0, 255);">Sub</span>
				<span style="color: rgb(0, 0, 0);"> deadline()<br />    </span>
				<span style="color: rgb(0, 0, 255);">Dim</span>
				<span style="color: rgb(0, 0, 0);"> deadtime </span>
				<span style="color: rgb(0, 0, 255);">As</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 255);">Date</span>
				<span style="color: rgb(0, 0, 0);">
						<br />    deadtime </span>
				<span style="color: rgb(0, 0, 0);">=</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 255);">DateAdd</span>
				<span style="color: rgb(0, 0, 0);">(</span>
				<span style="color: rgb(0, 0, 0);">"</span>
				<span style="color: rgb(0, 0, 0);">d</span>
				<span style="color: rgb(0, 0, 0);">"</span>
				<span style="color: rgb(0, 0, 0);">, Cells(</span>
				<span style="color: rgb(0, 0, 0);">2</span>
				<span style="color: rgb(0, 0, 0);">, </span>
				<span style="color: rgb(0, 0, 0);">2</span>
				<span style="color: rgb(0, 0, 0);">), </span>
				<span style="color: rgb(0, 0, 255);">Now</span>
				<span style="color: rgb(0, 0, 0);">)       </span>
				<span style="color: rgb(0, 128, 0);">'</span>
				<span style="color: rgb(0, 128, 0);">day</span>
				<span style="color: rgb(0, 128, 0);">
						<br />
				</span>
				<span style="color: rgb(0, 0, 0);">    deadtime </span>
				<span style="color: rgb(0, 0, 0);">=</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 255);">DateAdd</span>
				<span style="color: rgb(0, 0, 0);">(</span>
				<span style="color: rgb(0, 0, 0);">"</span>
				<span style="color: rgb(0, 0, 0);">h</span>
				<span style="color: rgb(0, 0, 0);">"</span>
				<span style="color: rgb(0, 0, 0);">, Cells(</span>
				<span style="color: rgb(0, 0, 0);">2</span>
				<span style="color: rgb(0, 0, 0);">, </span>
				<span style="color: rgb(0, 0, 0);">3</span>
				<span style="color: rgb(0, 0, 0);">), deadtime)  </span>
				<span style="color: rgb(0, 128, 0);">'</span>
				<span style="color: rgb(0, 128, 0);">hour</span>
				<span style="color: rgb(0, 128, 0);">
						<br />
				</span>
				<span style="color: rgb(0, 0, 0);">    deadtime </span>
				<span style="color: rgb(0, 0, 0);">=</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 255);">DateAdd</span>
				<span style="color: rgb(0, 0, 0);">(</span>
				<span style="color: rgb(0, 0, 0);">"</span>
				<span style="color: rgb(0, 0, 0);">n</span>
				<span style="color: rgb(0, 0, 0);">"</span>
				<span style="color: rgb(0, 0, 0);">, Cells(</span>
				<span style="color: rgb(0, 0, 0);">2</span>
				<span style="color: rgb(0, 0, 0);">, </span>
				<span style="color: rgb(0, 0, 0);">4</span>
				<span style="color: rgb(0, 0, 0);">), deadtime)  </span>
				<span style="color: rgb(0, 128, 0);">'</span>
				<span style="color: rgb(0, 128, 0);">minute</span>
				<span style="color: rgb(0, 128, 0);">
						<br />
				</span>
				<span style="color: rgb(0, 0, 0);">    ActiveCell.Value </span>
				<span style="color: rgb(0, 0, 0);">=</span>
				<span style="color: rgb(0, 0, 0);"> deadtime<br /></span>
				<span style="color: rgb(0, 0, 255);">End Sub</span>
				<span style="color: rgb(0, 0, 0);">
						<br />
				</span>
		</div>
		<br />
		<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;">
				<!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>-->
				<span style="color: rgb(0, 128, 0);">'</span>
				<span style="color: rgb(0, 128, 0);">选中右移</span>
				<span style="color: rgb(0, 128, 0);">
						<br />
				</span>
				<span style="color: rgb(0, 0, 0);">ActiveCell.Value </span>
				<span style="color: rgb(0, 0, 0);">=</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 0);">123</span>
				<span style="color: rgb(0, 0, 0);">
						<br />Cells(ActiveCell.Row, ActiveCell.Column </span>
				<span style="color: rgb(0, 0, 0);">+</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 0);">1</span>
				<span style="color: rgb(0, 0, 0);">).Select<br />ActiveCell.Value </span>
				<span style="color: rgb(0, 0, 0);">=</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 0);">456</span>
		</div>
		<br />
<img src ="http://www.blogjava.net/Jcat/aggbug/271788.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Jcat/" target="_blank">Jcat</a> 2009-05-20 20:20 <a href="http://www.blogjava.net/Jcat/archive/2009/05/20/271788.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Array in VBA</title><link>http://www.blogjava.net/Jcat/archive/2008/03/28/189328.html</link><dc:creator>Jcat</dc:creator><author>Jcat</author><pubDate>Fri, 28 Mar 2008 10:11:00 GMT</pubDate><guid>http://www.blogjava.net/Jcat/archive/2008/03/28/189328.html</guid><wfw:comment>http://www.blogjava.net/Jcat/comments/189328.html</wfw:comment><comments>http://www.blogjava.net/Jcat/archive/2008/03/28/189328.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/Jcat/comments/commentRss/189328.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Jcat/services/trackbacks/189328.html</trackback:ping><description><![CDATA[
		<b>Declaring and Initialization<br /></b>
		<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;">
				<span style="color: rgb(0, 0, 255);">Option</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 255);">Explicit</span>
				<span style="color: rgb(0, 0, 0);">
						<br /> <br /></span>
				<span style="color: rgb(0, 0, 255);">Sub</span>
				<span style="color: rgb(0, 0, 0);"> arrayInVBA()<br />    </span>
				<span style="color: rgb(0, 0, 255);">Dim</span>
				<span style="color: rgb(0, 0, 0);"> a1(</span>
				<span style="color: rgb(0, 0, 0);">5</span>
				<span style="color: rgb(0, 0, 0);">) </span>
				<span style="color: rgb(0, 0, 255);">As</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 255);">String</span>
				<span style="color: rgb(0, 0, 0);">
						<br />     Debug.Assert </span>
				<span style="color: rgb(0, 0, 255);">LBound</span>
				<span style="color: rgb(0, 0, 0);">(a1) </span>
				<span style="color: rgb(0, 0, 0);">=</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 0);">0</span>
				<span style="color: rgb(0, 0, 0);">
						<br />     Debug.Assert </span>
				<span style="color: rgb(0, 0, 255);">UBound</span>
				<span style="color: rgb(0, 0, 0);">(a1) </span>
				<span style="color: rgb(0, 0, 0);">=</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 0);">5</span>
				<span style="color: rgb(0, 0, 0);">
						<br />     Debug.Assert </span>
				<span style="color: rgb(0, 0, 255);">TypeName</span>
				<span style="color: rgb(0, 0, 0);">(a1) </span>
				<span style="color: rgb(0, 0, 0);">=</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 0);">"</span>
				<span style="color: rgb(0, 0, 0);">String()</span>
				<span style="color: rgb(0, 0, 0);">"</span>
				<span style="color: rgb(0, 0, 0);">
						<br />
						<br />    </span>
				<span style="color: rgb(0, 0, 255);">Dim</span>
				<span style="color: rgb(0, 0, 0);"> a2(</span>
				<span style="color: rgb(0, 0, 0);">2</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 255);">To</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 0);">5</span>
				<span style="color: rgb(0, 0, 0);">) </span>
				<span style="color: rgb(0, 0, 255);">As</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 255);">Integer</span>
				<span style="color: rgb(0, 0, 0);">
						<br />     Debug.Assert </span>
				<span style="color: rgb(0, 0, 255);">LBound</span>
				<span style="color: rgb(0, 0, 0);">(a2) </span>
				<span style="color: rgb(0, 0, 0);">=</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 0);">2</span>
				<span style="color: rgb(0, 0, 0);">
						<br />     Debug.Assert </span>
				<span style="color: rgb(0, 0, 255);">UBound</span>
				<span style="color: rgb(0, 0, 0);">(a2) </span>
				<span style="color: rgb(0, 0, 0);">=</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 0);">5</span>
				<span style="color: rgb(0, 0, 0);">
						<br />     Debug.Assert </span>
				<span style="color: rgb(0, 0, 255);">TypeName</span>
				<span style="color: rgb(0, 0, 0);">(a2) </span>
				<span style="color: rgb(0, 0, 0);">=</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 0);">"</span>
				<span style="color: rgb(0, 0, 0);">Integer()</span>
				<span style="color: rgb(0, 0, 0);">"</span>
				<span style="color: rgb(0, 0, 0);">
						<br />
						<br />    </span>
				<span style="color: rgb(0, 0, 255);">Dim</span>
				<span style="color: rgb(0, 0, 0);"> arrayFunction: arrayFunction </span>
				<span style="color: rgb(0, 0, 0);">=</span>
				<span style="color: rgb(0, 0, 0);"> Array(</span>
				<span style="color: rgb(0, 0, 0);">"</span>
				<span style="color: rgb(0, 0, 0);">aa</span>
				<span style="color: rgb(0, 0, 0);">"</span>
				<span style="color: rgb(0, 0, 0);">, </span>
				<span style="color: rgb(0, 0, 0);">"</span>
				<span style="color: rgb(0, 0, 0);">bb</span>
				<span style="color: rgb(0, 0, 0);">"</span>
				<span style="color: rgb(0, 0, 0);">, </span>
				<span style="color: rgb(0, 0, 0);">"</span>
				<span style="color: rgb(0, 0, 0);">cc</span>
				<span style="color: rgb(0, 0, 0);">"</span>
				<span style="color: rgb(0, 0, 0);">, </span>
				<span style="color: rgb(0, 0, 0);">"</span>
				<span style="color: rgb(0, 0, 0);">dd</span>
				<span style="color: rgb(0, 0, 0);">"</span>
				<span style="color: rgb(0, 0, 0);">, </span>
				<span style="color: rgb(0, 0, 0);">"</span>
				<span style="color: rgb(0, 0, 0);">ee</span>
				<span style="color: rgb(0, 0, 0);">"</span>
				<span style="color: rgb(0, 0, 0);">, </span>
				<span style="color: rgb(0, 0, 0);">"</span>
				<span style="color: rgb(0, 0, 0);">ff</span>
				<span style="color: rgb(0, 0, 0);">"</span>
				<span style="color: rgb(0, 0, 0);">)<br />     Debug.Assert </span>
				<span style="color: rgb(0, 0, 255);">LBound</span>
				<span style="color: rgb(0, 0, 0);">(arrayFunction) </span>
				<span style="color: rgb(0, 0, 0);">=</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 0);">0</span>
				<span style="color: rgb(0, 0, 0);">
						<br />     Debug.Assert </span>
				<span style="color: rgb(0, 0, 255);">UBound</span>
				<span style="color: rgb(0, 0, 0);">(arrayFunction) </span>
				<span style="color: rgb(0, 0, 0);">=</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 0);">5</span>
				<span style="color: rgb(0, 0, 0);">
						<br />     Debug.Assert </span>
				<span style="color: rgb(0, 0, 255);">TypeName</span>
				<span style="color: rgb(0, 0, 0);">(arrayFunction) </span>
				<span style="color: rgb(0, 0, 0);">=</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 0);">"</span>
				<span style="color: rgb(0, 0, 0);">Variant()</span>
				<span style="color: rgb(0, 0, 0);">"</span>
				<span style="color: rgb(0, 0, 0);">
						<br />
						<br />    </span>
				<span style="color: rgb(0, 128, 0);">'</span>
				<span style="color: rgb(0, 128, 0);">initialize by Array() function</span>
				<span style="color: rgb(0, 128, 0);">
						<br />
				</span>
				<span style="color: rgb(0, 0, 0);">    </span>
				<span style="color: rgb(0, 0, 255);">Dim</span>
				<span style="color: rgb(0, 0, 0);"> i </span>
				<span style="color: rgb(0, 0, 255);">As</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 255);">Integer</span>
				<span style="color: rgb(0, 0, 0);">
						<br />    </span>
				<span style="color: rgb(0, 0, 255);">For</span>
				<span style="color: rgb(0, 0, 0);"> i </span>
				<span style="color: rgb(0, 0, 0);">=</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 0);">0</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 255);">To</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 0);">5</span>
				<span style="color: rgb(0, 0, 0);">
						<br />        a1(i) </span>
				<span style="color: rgb(0, 0, 0);">=</span>
				<span style="color: rgb(0, 0, 0);"> arrayFunction(i)<br />    </span>
				<span style="color: rgb(0, 0, 255);">Next</span>
				<span style="color: rgb(0, 0, 0);"> i<br />    <br />    </span>
				<span style="color: rgb(0, 0, 255);">For</span>
				<span style="color: rgb(0, 0, 0);"> i </span>
				<span style="color: rgb(0, 0, 0);">=</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 0);">0</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 255);">To</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 0);">5</span>
				<span style="color: rgb(0, 0, 0);">
						<br />       Debug.Print a1(i)<br />    </span>
				<span style="color: rgb(0, 0, 255);">Next</span>
				<span style="color: rgb(0, 0, 0);"> i<br /></span>
				<span style="color: rgb(0, 0, 255);">End Sub</span>
		</div>
<img src ="http://www.blogjava.net/Jcat/aggbug/189328.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Jcat/" target="_blank">Jcat</a> 2008-03-28 18:11 <a href="http://www.blogjava.net/Jcat/archive/2008/03/28/189328.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Optional argument for Function</title><link>http://www.blogjava.net/Jcat/archive/2008/03/28/189294.html</link><dc:creator>Jcat</dc:creator><author>Jcat</author><pubDate>Fri, 28 Mar 2008 08:23:00 GMT</pubDate><guid>http://www.blogjava.net/Jcat/archive/2008/03/28/189294.html</guid><wfw:comment>http://www.blogjava.net/Jcat/comments/189294.html</wfw:comment><comments>http://www.blogjava.net/Jcat/archive/2008/03/28/189294.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/Jcat/comments/commentRss/189294.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Jcat/services/trackbacks/189294.html</trackback:ping><description><![CDATA[Note If you need to determine whether an optional argument was passed to a function, you <b>MUST </b>declare the optional argument as a <b>Variant </b>data type. Then you can use the <b>IsMissing </b>function within the procedure.<br /><br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 255);">Option</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">Explicit</span><span style="color: rgb(0, 0, 0);"><br /><br /></span><span style="color: rgb(0, 0, 255);">Function</span><span style="color: rgb(0, 0, 0);"> explicitType(</span><span style="color: rgb(0, 0, 255);">Optional</span><span style="color: rgb(0, 0, 0);"> s </span><span style="color: rgb(0, 0, 255);">As</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">Integer</span><span style="color: rgb(0, 0, 0);">)<br />    Debug.Assert IsNull(s) </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">False</span><span style="color: rgb(0, 0, 0);"><br />    Debug.Assert IsMissing(s) </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">False</span><span style="color: rgb(0, 0, 0);"><br />    Debug.Assert s </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);"><br />    explicitType </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> s<br /></span><span style="color: rgb(0, 0, 255);">End Function</span><span style="color: rgb(0, 0, 0);"><br /><br /><br /></span><span style="color: rgb(0, 0, 255);">Function</span><span style="color: rgb(0, 0, 0);"> variantType(</span><span style="color: rgb(0, 0, 255);">Optional</span><span style="color: rgb(0, 0, 0);"> s)<br />    Debug.Assert IsNull(s) </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">False</span><span style="color: rgb(0, 0, 0);"><br />    Debug.Assert IsMissing(s) </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">True</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 0);">    '</span><span style="color: rgb(0, 128, 0);">Debug.Print s  'Error 448</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);">    variantType </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> s<br /></span><span style="color: rgb(0, 0, 255);">End Function</span><span style="color: rgb(0, 0, 0);"><br /><br /><br /></span><span style="color: rgb(0, 0, 255);">Sub</span><span style="color: rgb(0, 0, 0);"> test()<br />    Debug.Print explicitType()<br />    Debug.Print variantType()<br /></span><span style="color: rgb(0, 0, 255);">End Sub</span></div><br /><img src ="http://www.blogjava.net/Jcat/aggbug/189294.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Jcat/" target="_blank">Jcat</a> 2008-03-28 16:23 <a href="http://www.blogjava.net/Jcat/archive/2008/03/28/189294.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>基础sample</title><link>http://www.blogjava.net/Jcat/archive/2008/03/26/188782.html</link><dc:creator>Jcat</dc:creator><author>Jcat</author><pubDate>Wed, 26 Mar 2008 08:26:00 GMT</pubDate><guid>http://www.blogjava.net/Jcat/archive/2008/03/26/188782.html</guid><wfw:comment>http://www.blogjava.net/Jcat/comments/188782.html</wfw:comment><comments>http://www.blogjava.net/Jcat/archive/2008/03/26/188782.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/Jcat/comments/commentRss/188782.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Jcat/services/trackbacks/188782.html</trackback:ping><description><![CDATA[
		<b>Controlling Function Recalculation</b>
		<br />
		<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;">
				<!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>-->
				<span style="color: rgb(0, 128, 0);">'</span>
				<span style="color: rgb(0, 128, 0);">the same as Round excel-function</span>
				<span style="color: rgb(0, 128, 0);">
						<br />
				</span>
				<span style="color: rgb(0, 0, 255);">Function</span>
				<span style="color: rgb(0, 0, 0);"> nonStaticRand()<br />    Application.Volatile </span>
				<span style="color: rgb(0, 0, 255);">True</span>
				<span style="color: rgb(0, 0, 0);">
						<br />    nonStaticRand </span>
				<span style="color: rgb(0, 0, 0);">=</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 255);">Rnd</span>
				<span style="color: rgb(0, 0, 0);">()   </span>
				<span style="color: rgb(0, 128, 0);">'</span>
				<span style="color: rgb(0, 128, 0);">Rnd is a vba-function</span>
				<span style="color: rgb(0, 128, 0);">
						<br />
				</span>
				<span style="color: rgb(0, 0, 255);">End Function</span>
				<span style="color: rgb(0, 0, 0);">
						<br />
						<br />
				</span>
				<span style="color: rgb(0, 128, 0);">'</span>
				<span style="color: rgb(0, 128, 0);">Calculate only once, so rand number won't be changed afterwards</span>
				<span style="color: rgb(0, 128, 0);">
						<br />
				</span>
				<span style="color: rgb(0, 0, 255);">Function</span>
				<span style="color: rgb(0, 0, 0);"> staticRand()<br />    Application.Volatile </span>
				<span style="color: rgb(0, 0, 255);">False</span>
				<span style="color: rgb(0, 0, 0);">  </span>
				<span style="color: rgb(0, 128, 0);">'</span>
				<span style="color: rgb(0, 128, 0);">you can ignore this line, default is False</span>
				<span style="color: rgb(0, 128, 0);">
						<br />
				</span>
				<span style="color: rgb(0, 0, 0);">    staticRand </span>
				<span style="color: rgb(0, 0, 0);">=</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 255);">Rnd</span>
				<span style="color: rgb(0, 0, 0);">()<br /></span>
				<span style="color: rgb(0, 0, 255);">End Function</span>
		</div>
		<br />
<img src ="http://www.blogjava.net/Jcat/aggbug/188782.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Jcat/" target="_blank">Jcat</a> 2008-03-26 16:26 <a href="http://www.blogjava.net/Jcat/archive/2008/03/26/188782.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Logic &amp; Loop</title><link>http://www.blogjava.net/Jcat/archive/2008/03/25/188551.html</link><dc:creator>Jcat</dc:creator><author>Jcat</author><pubDate>Tue, 25 Mar 2008 10:05:00 GMT</pubDate><guid>http://www.blogjava.net/Jcat/archive/2008/03/25/188551.html</guid><wfw:comment>http://www.blogjava.net/Jcat/comments/188551.html</wfw:comment><comments>http://www.blogjava.net/Jcat/archive/2008/03/25/188551.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/Jcat/comments/commentRss/188551.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Jcat/services/trackbacks/188551.html</trackback:ping><description><![CDATA[
		<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;">
				<!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>-->
				<span style="color: rgb(0, 0, 0);">    </span>
				<span style="color: rgb(0, 128, 0);">'</span>
				<span style="color: rgb(0, 128, 0);">'Logical Structures</span>
				<span style="color: rgb(0, 128, 0);">
						<br />
				</span>
				<span style="color: rgb(0, 0, 0);">    </span>
				<span style="color: rgb(0, 0, 255);">Dim</span>
				<span style="color: rgb(0, 0, 0);"> flag </span>
				<span style="color: rgb(0, 0, 255);">As</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 255);">Integer</span>
				<span style="color: rgb(0, 0, 0);">
						<br />    </span>
				<span style="color: rgb(0, 128, 0);">'</span>
				<span style="color: rgb(0, 128, 0);">1)</span>
				<span style="color: rgb(0, 128, 0);">
						<br />
				</span>
				<span style="color: rgb(0, 0, 0);">    </span>
				<span style="color: rgb(0, 0, 255);">If</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 255);">True</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 255);">Then</span>
				<span style="color: rgb(0, 0, 0);"> flag </span>
				<span style="color: rgb(0, 0, 0);">=</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 0);">1</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 255);">Else</span>
				<span style="color: rgb(0, 0, 0);"> flag </span>
				<span style="color: rgb(0, 0, 0);">=</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 0);">0</span>
				<span style="color: rgb(0, 0, 0);">
						<br />    Debug.Assert flag </span>
				<span style="color: rgb(0, 0, 0);">=</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 0);">1</span>
				<span style="color: rgb(0, 0, 0);">
						<br />    </span>
				<span style="color: rgb(0, 128, 0);">'</span>
				<span style="color: rgb(0, 128, 0);">2)</span>
				<span style="color: rgb(0, 128, 0);">
						<br />
				</span>
				<span style="color: rgb(0, 0, 0);">    </span>
				<span style="color: rgb(0, 0, 255);">If</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 255);">False</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 255);">Then</span>
				<span style="color: rgb(0, 0, 0);">
						<br />        flag </span>
				<span style="color: rgb(0, 0, 0);">=</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 0);">1</span>
				<span style="color: rgb(0, 0, 0);">
						<br />    </span>
				<span style="color: rgb(0, 0, 255);">Else</span>
				<span style="color: rgb(0, 0, 0);">
						<br />        flag </span>
				<span style="color: rgb(0, 0, 0);">=</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 0);">0</span>
				<span style="color: rgb(0, 0, 0);">
						<br />    </span>
				<span style="color: rgb(0, 0, 255);">End</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 255);">If</span>
				<span style="color: rgb(0, 0, 0);">
						<br />    Debug.Assert flag </span>
				<span style="color: rgb(0, 0, 0);">=</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 0);">0</span>
				<span style="color: rgb(0, 0, 0);">
						<br />    </span>
				<span style="color: rgb(0, 128, 0);">'</span>
				<span style="color: rgb(0, 128, 0);">3)</span>
				<span style="color: rgb(0, 128, 0);">
						<br />
				</span>
				<span style="color: rgb(0, 0, 0);">    flag </span>
				<span style="color: rgb(0, 0, 0);">=</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 255);">IIf</span>
				<span style="color: rgb(0, 0, 0);">(</span>
				<span style="color: rgb(0, 0, 255);">True</span>
				<span style="color: rgb(0, 0, 0);">, </span>
				<span style="color: rgb(0, 0, 0);">1</span>
				<span style="color: rgb(0, 0, 0);">, </span>
				<span style="color: rgb(0, 0, 0);">0</span>
				<span style="color: rgb(0, 0, 0);">)<br />    Debug.Assert flag </span>
				<span style="color: rgb(0, 0, 0);">=</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 0);">1</span>
				<span style="color: rgb(0, 0, 0);">
						<br />    <br />    </span>
				<span style="color: rgb(0, 128, 0);">'</span>
				<span style="color: rgb(0, 128, 0);">'Logical Operators</span>
				<span style="color: rgb(0, 128, 0);">
						<br />
				</span>
				<span style="color: rgb(0, 0, 0);">    Debug.Assert (</span>
				<span style="color: rgb(0, 0, 0);">1</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 0);">=</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 0);">1</span>
				<span style="color: rgb(0, 0, 0);">) </span>
				<span style="color: rgb(0, 0, 0);">=</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 255);">True</span>
				<span style="color: rgb(0, 0, 0);">
						<br />    Debug.Assert </span>
				<span style="color: rgb(0, 0, 255);">Not</span>
				<span style="color: rgb(0, 0, 0);"> (</span>
				<span style="color: rgb(0, 0, 0);">1</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 0);">=</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 0);">1</span>
				<span style="color: rgb(0, 0, 0);">) </span>
				<span style="color: rgb(0, 0, 0);">=</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 255);">False</span>
				<span style="color: rgb(0, 0, 0);">
						<br />    Debug.Assert (</span>
				<span style="color: rgb(0, 0, 255);">True</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 255);">And</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 255);">False</span>
				<span style="color: rgb(0, 0, 0);">) </span>
				<span style="color: rgb(0, 0, 0);">=</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 255);">False</span>
				<span style="color: rgb(0, 0, 0);">
						<br />    Debug.Assert (</span>
				<span style="color: rgb(0, 0, 255);">True</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 255);">Or</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 255);">False</span>
				<span style="color: rgb(0, 0, 0);">) </span>
				<span style="color: rgb(0, 0, 0);">=</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 255);">True</span>
				<span style="color: rgb(0, 0, 0);">
						<br />
				</span>
		</div>
		<br />
		<br />
		<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;">
				<!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>-->
				<span style="color: rgb(0, 128, 0);">'</span>
				<span style="color: rgb(0, 128, 0);">'Loop Structure</span>
				<span style="color: rgb(0, 128, 0);">
						<br />
				</span>
				<span style="color: rgb(0, 0, 255);">For</span>
				<span style="color: rgb(0, 0, 0);"> i </span>
				<span style="color: rgb(0, 0, 0);">=</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 0);">1</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 255);">To</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 0);">5</span>
				<span style="color: rgb(0, 0, 0);">
						<br />    <img src="http://www.blogjava.net/images/dot.gif" /><br />    </span>
				<span style="color: rgb(0, 0, 255);">If</span>
				<span style="color: rgb(0, 0, 0);"> <img src="http://www.blogjava.net/images/dot.gif" /> </span>
				<span style="color: rgb(0, 0, 255);">Then</span>
				<span style="color: rgb(0, 0, 0);">
						<br />        </span>
				<span style="color: rgb(0, 0, 255);">Exit</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 255);">For</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 128, 0);">'</span>
				<span style="color: rgb(0, 128, 0);">相当于Break</span>
				<span style="color: rgb(0, 128, 0);">
						<br />
				</span>
				<span style="color: rgb(0, 0, 0);">    </span>
				<span style="color: rgb(0, 0, 255);">End</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 255);">If</span>
				<span style="color: rgb(0, 0, 0);">
						<br />
				</span>
				<span style="color: rgb(0, 0, 255);">Next</span>
				<span style="color: rgb(0, 0, 0);"> i</span>
		</div>
		<br />
<img src ="http://www.blogjava.net/Jcat/aggbug/188551.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Jcat/" target="_blank">Jcat</a> 2008-03-25 18:05 <a href="http://www.blogjava.net/Jcat/archive/2008/03/25/188551.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>语法基础</title><link>http://www.blogjava.net/Jcat/archive/2008/03/20/187437.html</link><dc:creator>Jcat</dc:creator><author>Jcat</author><pubDate>Thu, 20 Mar 2008 03:16:00 GMT</pubDate><guid>http://www.blogjava.net/Jcat/archive/2008/03/20/187437.html</guid><wfw:comment>http://www.blogjava.net/Jcat/comments/187437.html</wfw:comment><comments>http://www.blogjava.net/Jcat/archive/2008/03/20/187437.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/Jcat/comments/commentRss/187437.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Jcat/services/trackbacks/187437.html</trackback:ping><description><![CDATA[
		<font color="#0000ff">
				<font color="#000000">
						<b>Options</b>
				</font>
				<br />Option Explicit</font>
		<br />
		<font color="#008000">You must explicitly define each variable that you use.</font>
		<br />
		<br />
		<font color="#0000ff">Option Private Module</font>
		<br />
		<font color="#008000">You can force all procedures in a module to be private - even those declared with the Public keyword. <br />You can omit the Private keyword from your Sub declarations.<br /></font>
		<br />
		<font color="#0000ff">Option Base [01]<br /><font color="#008000">The lower bound of an array, created using the Array function, is determined by Option Base statement at the top of the module. The default lower bound is 0</font><br /></font>
		<br />
		<br />
		<b>Declaring Variables</b>
		<br />
		<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;">
				<!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>-->
				<span style="color: rgb(0, 0, 255);">Dim</span>
				<span style="color: rgb(0, 0, 0);"> 变量 </span>
				<span style="color: rgb(0, 0, 255);">As</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 255);">String</span>
				<span style="color: rgb(0, 0, 0);">
						<br />变量 </span>
				<span style="color: rgb(0, 0, 0);">=</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 0);">"</span>
				<span style="color: rgb(0, 0, 0);">initialization</span>
				<span style="color: rgb(0, 0, 0);">"</span>
				<span style="color: rgb(0, 0, 0);">
						<br />
						<br />
				</span>
				<span style="color: rgb(0, 0, 255);">Const</span>
				<span style="color: rgb(0, 0, 0);"> 常量 </span>
				<span style="color: rgb(0, 0, 255);">As</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 255);">String</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 0);">=</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 0);">"</span>
				<span style="color: rgb(0, 0, 0);">initialization</span>
				<span style="color: rgb(0, 0, 0);">"</span>
				<span style="color: rgb(0, 0, 0);">
						<br />
						<br />
				</span>
				<span style="color: rgb(0, 0, 255);">Dim</span>
				<span style="color: rgb(0, 0, 0);"> 定长字符串 </span>
				<span style="color: rgb(0, 0, 255);">As</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 255);">String</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 0);">*</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 0);">10</span>
				<span style="color: rgb(0, 0, 0);">
						<br />定长字符串 </span>
				<span style="color: rgb(0, 0, 0);">=</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 0);">"</span>
				<span style="color: rgb(0, 0, 0);">超过ten个无效（中文英文都算1个，看来编码用的unicode）</span>
				<span style="color: rgb(0, 0, 0);">"</span>
		</div>
		<br />
		<br />
		<br />
		<b>Executing Sub from another Procedure</b>
		<br />
		<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;">
				<!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>-->
				<span style="color: rgb(0, 0, 255);">Option</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 255);">Explicit</span>
				<span style="color: rgb(0, 0, 0);">
						<br />
						<br />
						<br />
				</span>
				<span style="color: rgb(0, 0, 255);">Sub</span>
				<span style="color: rgb(0, 0, 0);"> executingWay()<br />    add </span>
				<span style="color: rgb(0, 0, 0);">"</span>
				<span style="color: rgb(0, 0, 0);">flame</span>
				<span style="color: rgb(0, 0, 0);">"</span>
				<span style="color: rgb(0, 0, 0);">, </span>
				<span style="color: rgb(0, 0, 0);">1</span>
				<span style="color: rgb(0, 0, 0);">, </span>
				<span style="color: rgb(0, 0, 0);">2</span>
				<span style="color: rgb(0, 0, 0);">
						<br />
						<br />
				</span>
				<span style="color: rgb(0, 0, 255);">    Call</span>
				<span style="color: rgb(0, 0, 0);"> add(</span>
				<span style="color: rgb(0, 0, 0);">"</span>
				<span style="color: rgb(0, 0, 0);">call</span>
				<span style="color: rgb(0, 0, 0);">"</span>
				<span style="color: rgb(0, 0, 0);">, </span>
				<span style="color: rgb(0, 0, 0);">1</span>
				<span style="color: rgb(0, 0, 0);">, </span>
				<span style="color: rgb(0, 0, 0);">2</span>
				<span style="color: rgb(0, 0, 0);">)<br /><br /></span>
				<span style="color: rgb(0, 0, 255);">    Dim</span>
				<span style="color: rgb(0, 0, 0);"> subName </span>
				<span style="color: rgb(0, 0, 255);">As</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 255);">String</span>
				<span style="color: rgb(0, 0, 0);">: subName </span>
				<span style="color: rgb(0, 0, 0);">=</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 0);">"</span>
				<span style="color: rgb(0, 0, 0);">add</span>
				<span style="color: rgb(0, 0, 0);">"</span>
				<span style="color: rgb(0, 0, 0);">
						<br />    Run subName, </span>
				<span style="color: rgb(0, 0, 0);">"</span>
				<span style="color: rgb(0, 0, 0);">run</span>
				<span style="color: rgb(0, 0, 0);">"</span>
				<span style="color: rgb(0, 0, 0);">, </span>
				<span style="color: rgb(0, 0, 0);">1</span>
				<span style="color: rgb(0, 0, 0);">, </span>
				<span style="color: rgb(0, 0, 0);">2</span>
				<span style="color: rgb(0, 0, 0);">
						<br />
				</span>
				<span style="color: rgb(0, 0, 255);">End Sub</span>
				<span style="color: rgb(0, 0, 0);">
						<br />
						<br />
						<br />
				</span>
				<span style="color: rgb(0, 0, 255);">Sub</span>
				<span style="color: rgb(0, 0, 0);"> add(exeBy </span>
				<span style="color: rgb(0, 0, 255);">As</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 255);">String</span>
				<span style="color: rgb(0, 0, 0);">, x </span>
				<span style="color: rgb(0, 0, 255);">As</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 255);">Integer</span>
				<span style="color: rgb(0, 0, 0);">, y </span>
				<span style="color: rgb(0, 0, 255);">As</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 255);">Integer</span>
				<span style="color: rgb(0, 0, 0);">)<br /></span>
				<span style="color: rgb(0, 0, 255);">    MsgBox</span>
				<span style="color: rgb(0, 0, 0);"> exeBy </span>
				<span style="color: rgb(0, 0, 0);">&amp;</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 0);">"</span>
				<span style="color: rgb(0, 0, 0);">: </span>
				<span style="color: rgb(0, 0, 0);">"</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 0);">&amp;</span>
				<span style="color: rgb(0, 0, 0);"> (x </span>
				<span style="color: rgb(0, 0, 0);">+</span>
				<span style="color: rgb(0, 0, 0);"> y)<br /></span>
				<span style="color: rgb(0, 0, 255);">End Sub</span>
		</div>
		<br />
		<br />
		<b>Executing Function from another Procedure</b>
		<br />
		<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;">
				<!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>-->
				<span style="color: rgb(0, 0, 255);">Option</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 255);">Explicit</span>
				<span style="color: rgb(0, 0, 0);">
						<br />
						<br />
				</span>
				<span style="color: rgb(0, 0, 255);">Function</span>
				<span style="color: rgb(0, 0, 0);"> executingWay()<br />    Debug.Print add(</span>
				<span style="color: rgb(0, 0, 0);">"</span>
				<span style="color: rgb(0, 0, 0);">flame</span>
				<span style="color: rgb(0, 0, 0);">"</span>
				<span style="color: rgb(0, 0, 0);">, </span>
				<span style="color: rgb(0, 0, 0);">1</span>
				<span style="color: rgb(0, 0, 0);">, </span>
				<span style="color: rgb(0, 0, 0);">2</span>
				<span style="color: rgb(0, 0, 0);">)<br /><br /></span>
				<span style="color: rgb(0, 0, 255);">    Dim</span>
				<span style="color: rgb(0, 0, 0);"> funcName   </span>
				<span style="color: rgb(0, 0, 255);">As</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 255);">String</span>
				<span style="color: rgb(0, 0, 0);">: funcName </span>
				<span style="color: rgb(0, 0, 0);">=</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 0);">"</span>
				<span style="color: rgb(0, 0, 0);">add</span>
				<span style="color: rgb(0, 0, 0);">"</span>
				<span style="color: rgb(0, 0, 0);">
						<br />    Debug.Print Run(funcName, </span>
				<span style="color: rgb(0, 0, 0);">"</span>
				<span style="color: rgb(0, 0, 0);">run</span>
				<span style="color: rgb(0, 0, 0);">"</span>
				<span style="color: rgb(0, 0, 0);">, </span>
				<span style="color: rgb(0, 0, 0);">1</span>
				<span style="color: rgb(0, 0, 0);">, </span>
				<span style="color: rgb(0, 0, 0);">2</span>
				<span style="color: rgb(0, 0, 0);">)<br /></span>
				<span style="color: rgb(0, 0, 255);">End Function</span>
				<span style="color: rgb(0, 0, 0);">
						<br />
						<br />
						<br />
				</span>
				<span style="color: rgb(0, 0, 255);">Function</span>
				<span style="color: rgb(0, 0, 0);"> add(exeBy </span>
				<span style="color: rgb(0, 0, 255);">As</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 255);">String</span>
				<span style="color: rgb(0, 0, 0);">, x </span>
				<span style="color: rgb(0, 0, 255);">As</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 255);">Integer</span>
				<span style="color: rgb(0, 0, 0);">, y </span>
				<span style="color: rgb(0, 0, 255);">As</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 255);">Integer</span>
				<span style="color: rgb(0, 0, 0);">) </span>
				<span style="color: rgb(0, 0, 255);">As</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 255);">String</span>
				<span style="color: rgb(0, 0, 0);">
						<br />    add </span>
				<span style="color: rgb(0, 0, 0);">=</span>
				<span style="color: rgb(0, 0, 0);"> exeBy </span>
				<span style="color: rgb(0, 0, 0);">&amp;</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 0);">"</span>
				<span style="color: rgb(0, 0, 0);">: </span>
				<span style="color: rgb(0, 0, 0);">"</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 0);">&amp;</span>
				<span style="color: rgb(0, 0, 0);"> (x </span>
				<span style="color: rgb(0, 0, 0);">+</span>
				<span style="color: rgb(0, 0, 0);"> y)<br /></span>
				<span style="color: rgb(0, 0, 255);">End Function</span>
		</div>
		<br />
<img src ="http://www.blogjava.net/Jcat/aggbug/187437.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Jcat/" target="_blank">Jcat</a> 2008-03-20 11:16 <a href="http://www.blogjava.net/Jcat/archive/2008/03/20/187437.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>