锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲日本va一区二区三区,91嫩草私人成人亚洲影院,亚洲成综合人影院在院播放http://m.tkk7.com/crazycoding/category/46060.htmlGod helps those who help themselves. zh-cnWed, 08 Sep 2010 15:28:39 GMTWed, 08 Sep 2010 15:28:39 GMT60VBA瀹炵敤浠g爜鑺傞?/title><link>http://m.tkk7.com/crazycoding/archive/2010/09/08/331418.html</link><dc:creator>Ying-er</dc:creator><author>Ying-er</author><pubDate>Wed, 08 Sep 2010 10:15:00 GMT</pubDate><guid>http://m.tkk7.com/crazycoding/archive/2010/09/08/331418.html</guid><wfw:comment>http://m.tkk7.com/crazycoding/comments/331418.html</wfw:comment><comments>http://m.tkk7.com/crazycoding/archive/2010/09/08/331418.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/crazycoding/comments/commentRss/331418.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/crazycoding/services/trackbacks/331418.html</trackback:ping><description><![CDATA[<div style="background-color: #eeeeee; font-size: 13px; border: 1px solid #cccccc; padding: 4px 5px 4px 4px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: #008000;">'</span><span style="color: #008000;">/////////////////////////////////////////////////////////////</span><span style="color: #008000;"><br /> '</span><span style="color: #008000;">            -銉兗銈偡銉箋儓鍐呫伄銉囥兗銈褲伄鍒濇湡鍖栥倰琛屻亞-</span><span style="color: #008000;"><br /> '</span><span style="color: #008000;">/////////////////////////////////////////////////////////////</span><span style="color: #008000;"><br /> </span><span style="color: #0000ff;">Function</span><span style="color: #000000;"> CmdClear()<br />     </span><span style="color: #0000ff;">Dim</span><span style="color: #000000;"> sakiSH </span><span style="color: #0000ff;">As</span><span style="color: #000000;"> Worksheet<br />     </span><span style="color: #0000ff;">Beep</span><span style="color: #000000;"><br />         </span><span style="color: #0000ff;">Set</span><span style="color: #000000;"> sakiSH </span><span style="color: #000000;">=</span><span style="color: #000000;"> ThisWorkbook.Sheets(</span><span style="color: #000000;">2</span><span style="color: #000000;">) </span><span style="color: #008000;">'</span><span style="color: #008000;">杌㈣鍏堛伄銈楓兗銉?/span><span style="color: #008000;"><br /> </span><span style="color: #000000;">        sakiSH.Range(</span><span style="color: #000000;">"</span><span style="color: #000000;">A4:O1000</span><span style="color: #000000;">"</span><span style="color: #000000;">).ClearContents<br />         sakiSH.Range(</span><span style="color: #000000;">"</span><span style="color: #000000;">A4:O1000</span><span style="color: #000000;">"</span><span style="color: #000000;">).Clear<br />         </span><span style="color: #0000ff;">Set</span><span style="color: #000000;"> sakiSH </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000ff;">Nothing</span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;">End Function</span></div> <br /> <div style="background-color: #eeeeee; font-size: 13px; border: 1px solid #cccccc; padding: 4px 5px 4px 4px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: #008000;">'</span><span style="color: #008000;">/////////////////////////////////////////////////////////////</span><span style="color: #008000;"><br /> '</span><span style="color: #008000;">paintCellsLine</span><span style="color: #008000;"><br /> '</span><span style="color: #008000;">浣褲亜鏂癸細(xì)</span><span style="color: #008000;"><br /> '</span><span style="color: #008000;">    Dim startCell As Range</span><span style="color: #008000;"><br /> '</span><span style="color: #008000;">    Dim endCell   As Range</span><span style="color: #008000;"><br /> '</span><span style="color: #008000;">    Set startCell = Workbooks(1).Sheets(2).Cells(4, 1)</span><span style="color: #008000;"><br /> '</span><span style="color: #008000;">    Set endCell   = Workbooks(1).Sheets(2).Cells(48, 9)</span><span style="color: #008000;"><br /> '</span><span style="color: #008000;">    Call paintCellsLine(startCell, endCell)</span><span style="color: #008000;"><br /> '</span><span style="color: #008000;">@param startCell</span><span style="color: #008000;"><br /> '</span><span style="color: #008000;">@param endCell</span><span style="color: #008000;"><br /> '</span><span style="color: #008000;">/////////////////////////////////////////////////////////////</span><span style="color: #008000;"><br /> </span><span style="color: #0000ff;">Function</span><span style="color: #000000;"> paintCellsLine(startCell </span><span style="color: #0000ff;">As</span><span style="color: #000000;"> Range, endCell </span><span style="color: #0000ff;">As</span><span style="color: #000000;"> Range)<br />     </span><span style="color: #0000ff;">With</span><span style="color: #000000;"> Range(startCell, endCell)<br />         </span><span style="color: #0000ff;">For</span><span style="color: #000000;"> i </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #000000;">7</span><span style="color: #000000;"> </span><span style="color: #0000ff;">To</span><span style="color: #000000;"> </span><span style="color: #000000;">12</span><span style="color: #000000;"><br />             .Borders(i).LineStyle </span><span style="color: #000000;">=</span><span style="color: #000000;"> xlContinuous<br />         </span><span style="color: #0000ff;">Next</span><span style="color: #000000;"><br />     </span><span style="color: #0000ff;">End</span><span style="color: #000000;"> </span><span style="color: #0000ff;">With</span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;">End Function</span></div> <br /> VBA榪濪B<br /> <div style="background-color: #eeeeee; font-size: 13px; border: 1px solid #cccccc; padding: 4px 5px 4px 4px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: #0000ff;">Dim</span><span style="color: #000000;"> sqlStr </span><span style="color: #0000ff;">As</span><span style="color: #000000;"> </span><span style="color: #0000ff;">String</span><span style="color: #000000;"><br />             sqlStr </span><span style="color: #000000;">=</span><span style="color: #000000;"> getSqlStr()<br />         </span><span style="color: #0000ff;">Dim</span><span style="color: #000000;"> connection </span><span style="color: #0000ff;">As</span><span style="color: #000000;"> </span><span style="color: #0000ff;">New</span><span style="color: #000000;"> ADODB.connection<br />         </span><span style="color: #0000ff;">Dim</span><span style="color: #000000;"> resultSet </span><span style="color: #0000ff;">As</span><span style="color: #000000;"> ADODB.recordSet<br />         </span><span style="color: #0000ff;">Dim</span><span style="color: #000000;"> connStr </span><span style="color: #0000ff;">As</span><span style="color: #000000;"> </span><span style="color: #0000ff;">String</span><span style="color: #000000;"><br />             connStr </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #000000;">"</span><span style="color: #000000;">Provider=SQLOLEDB;Server=127.0.0.1;Database=BMS;Trusted_Connection=yes;Uid=sa;Pwd=</span><span style="color: #000000;">"</span><span style="color: #000000;"><br />             connection.Open connStr<br />             </span><span style="color: #0000ff;">Set</span><span style="color: #000000;"> resultSet </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000ff;">New</span><span style="color: #000000;"> ADODB.recordSet<br />             resultSet.Open sqlStr, connection</span></div> <br /> Dictionary鐨勪嬌鐢紙add Microsoft Scripting Runtime.錛? <div style="background-color: #eeeeee; font-size: 13px; border: 1px solid #cccccc; padding: 4px 5px 4px 4px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: #0000ff;">Dim</span><span style="color: #000000;"> dict<br /> <br /> </span><span style="color: #008000;">'</span><span style="color: #008000;"> 鍒涘緩Dictionary</span><span style="color: #008000;"><br /> </span><span style="color: #0000ff;">Set</span><span style="color: #000000;"> dict </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000ff;">CreateObject</span><span style="color: #000000;">(</span><span style="color: #000000;">"</span><span style="color: #000000;">Scripting.Dictionary</span><span style="color: #000000;">"</span><span style="color: #000000;">)<br /> <br /> </span><span style="color: #008000;">'</span><span style="color: #008000;"> 澧炲姞欏圭洰</span><span style="color: #008000;"><br /> </span><span style="color: #000000;">dict.Add </span><span style="color: #000000;">"</span><span style="color: #000000;">A</span><span style="color: #000000;">"</span><span style="color: #000000;">, </span><span style="color: #000000;">300</span><span style="color: #000000;"><br /> dict.Add </span><span style="color: #000000;">"</span><span style="color: #000000;">B</span><span style="color: #000000;">"</span><span style="color: #000000;">, </span><span style="color: #000000;">400</span><span style="color: #000000;"><br /> dict.Add </span><span style="color: #000000;">"</span><span style="color: #000000;">C</span><span style="color: #000000;">"</span><span style="color: #000000;">, </span><span style="color: #000000;">500</span><span style="color: #000000;"><br /> <br /> </span><span style="color: #008000;">'</span><span style="color: #008000;"> 緇熻欏圭洰鏁?/span><span style="color: #008000;"><br /> </span><span style="color: #000000;">n </span><span style="color: #000000;">=</span><span style="color: #000000;"> dict.Count<br /> <br /> </span><span style="color: #008000;">'</span><span style="color: #008000;"> 鍒犻櫎欏圭洰</span><span style="color: #008000;"><br /> </span><span style="color: #000000;">dict.Remove (</span><span style="color: #000000;">"</span><span style="color: #000000;">A</span><span style="color: #000000;">"</span><span style="color: #000000;">)<br /> <br /> </span><span style="color: #008000;">'</span><span style="color: #008000;"> 鍒ゆ柇瀛楀吀涓槸鍚﹀寘鍚叧閿瓧</span><span style="color: #008000;"><br /> </span><span style="color: #000000;">dict.exists (</span><span style="color: #000000;">"</span><span style="color: #000000;">B</span><span style="color: #000000;">"</span><span style="color: #000000;">)<br /> <br /> </span><span style="color: #008000;">'</span><span style="color: #008000;"> 鍙栧叧閿瓧瀵瑰簲鐨勫鹼紝娉ㄦ剰鍦ㄤ嬌鐢ㄥ墠闇瑕佸垽鏂槸鍚﹀瓨鍦╧ey錛屽惁鍒檇ict涓細(xì)澶氬嚭涓鏉¤褰?/span><span style="color: #008000;"><br /> </span><span style="color: #000000;">Value </span><span style="color: #000000;">=</span><span style="color: #000000;"> dict.Item(</span><span style="color: #000000;">"</span><span style="color: #000000;">B</span><span style="color: #000000;">"</span><span style="color: #000000;">)<br /> <br /> </span><span style="color: #008000;">'</span><span style="color: #008000;"> 淇敼鍏抽敭瀛楀搴旂殑鍊?濡備笉瀛樺湪鍒欏垱寤烘柊鐨勯」鐩?/span><span style="color: #008000;"><br /> </span><span style="color: #000000;">dict.Item(</span><span style="color: #000000;">"</span><span style="color: #000000;">B</span><span style="color: #000000;">"</span><span style="color: #000000;">) </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #000000;">1000</span><span style="color: #000000;"><br /> dict.Item(</span><span style="color: #000000;">"</span><span style="color: #000000;">D</span><span style="color: #000000;">"</span><span style="color: #000000;">) </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #000000;">800</span><span style="color: #000000;"><br /> <br /> </span><span style="color: #008000;">'</span><span style="color: #008000;"> 瀵瑰瓧鍏歌繘琛屽驚鐜?/span><span style="color: #008000;"><br /> </span><span style="color: #000000;">k </span><span style="color: #000000;">=</span><span style="color: #000000;"> dict.keys<br /> v </span><span style="color: #000000;">=</span><span style="color: #000000;"> dict.Items<br /> </span><span style="color: #0000ff;">For</span><span style="color: #000000;"> i </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #000000;">0</span><span style="color: #000000;"> </span><span style="color: #0000ff;">To</span><span style="color: #000000;"> dict.Count </span><span style="color: #000000;">-</span><span style="color: #000000;"> </span><span style="color: #000000;">1</span><span style="color: #000000;"><br />   key </span><span style="color: #000000;">=</span><span style="color: #000000;"> k(i)<br />   Value </span><span style="color: #000000;">=</span><span style="color: #000000;"> v(i)<br />   </span><span style="color: #0000ff;">MsgBox</span><span style="color: #000000;"> key </span><span style="color: #000000;">&</span><span style="color: #000000;"> Value<br /> </span><span style="color: #0000ff;">Next</span><span style="color: #000000;"><br /> <br /> </span><span style="color: #008000;">'</span><span style="color: #008000;"> 鍒犻櫎鎵鏈夐」鐩?/span><span style="color: #008000;"><br /> </span><span style="color: #000000;">dict.Removeall</span></div> <br /> VBA緙栫▼榛勯噾娉曞垯錛?br /> 褰曞埗瀹忥紝淇敼褰曞埗鐨勫畯涓哄繁鎵鐢?br /> <br /> <img src ="http://m.tkk7.com/crazycoding/aggbug/331418.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/crazycoding/" target="_blank">Ying-er</a> 2010-09-08 18:15 <a href="http://m.tkk7.com/crazycoding/archive/2010/09/08/331418.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>VBA鏃墮棿鍑芥暟http://m.tkk7.com/crazycoding/archive/2010/09/08/331415.htmlYing-erYing-erWed, 08 Sep 2010 09:32:00 GMThttp://m.tkk7.com/crazycoding/archive/2010/09/08/331415.htmlhttp://m.tkk7.com/crazycoding/comments/331415.htmlhttp://m.tkk7.com/crazycoding/archive/2010/09/08/331415.html#Feedback0http://m.tkk7.com/crazycoding/comments/commentRss/331415.htmlhttp://m.tkk7.com/crazycoding/services/trackbacks/331415.htmlNow 榪斿洖涓涓?Variant (Date)錛屾牴鎹綆楁満緋葷粺璁劇疆鐨勬棩鏈熷拰鏃墮棿鏉ユ寚瀹氭棩鏈熷拰鏃墮棿銆?br /> Date 榪斿洖鍖呭惈緋葷粺鏃ユ湡鐨?Variant (Date)銆?br /> Time 榪斿洖涓涓寚鏄庡綋鍓嶇郴緇熸椂闂寸殑 Variant (Date)銆?br /> Timer 榪斿洖涓涓?Single錛屼唬琛ㄤ粠鍗堝寮濮嬪埌鐜板湪緇忚繃鐨勭鏁般?br /> TimeSerial(hour, minute, second) 榪斿洖涓涓?Variant (Date)錛屽寘鍚叿鏈夊叿浣撴椂銆佸垎銆佺鐨勬椂闂淬?br /> DateDiff(interval, date1, date2[, firstdayofweek[, firstweekofyear]]) 榪斿洖 Variant (Long) 鐨勫鹼紝琛ㄧず涓や釜鎸囧畾鏃ユ湡闂寸殑鏃墮棿闂撮殧鏁扮洰
Second(time) 榪斿洖涓涓?Variant (Integer)錛屽叾鍊間負(fù) 0 鍒?59 涔嬮棿鐨勬暣鏁幫紝琛ㄧず涓鍒嗛挓涔嬩腑鐨勬煇涓
Minute(time) 榪斿洖涓涓?Variant (Integer)錛屽叾鍊間負(fù) 0 鍒?59 涔嬮棿鐨勬暣鏁幫紝琛ㄧず涓灝忔椂涓殑鏌愬垎閽?br /> Hour(time) 榪斿洖涓涓?Variant (Integer)錛屽叾鍊間負(fù) 0 鍒?23 涔嬮棿鐨勬暣鏁幫紝琛ㄧず涓澶╀箣涓殑鏌愪竴閽熺偣
Day(date) 榪斿洖涓涓?Variant (Integer)錛屽叾鍊間負(fù) 1 鍒?31 涔嬮棿鐨勬暣鏁幫紝琛ㄧず涓涓湀涓殑鏌愪竴鏃?br /> Month(date) 榪斿洖涓涓?Variant (Integer)錛屽叾鍊間負(fù) 1 鍒?12 涔嬮棿鐨勬暣鏁幫紝琛ㄧず涓騫翠腑鐨勬煇鏈?br /> Year(date) 榪斿洖 Variant (Integer)錛屽寘鍚〃紺哄勾浠界殑鏁存暟銆?br /> Weekday(date, [firstdayofweek]) 榪斿洖涓涓?Variant (Integer)錛屽寘鍚竴涓暣鏁幫紝浠h〃鏌愪釜鏃ユ湡鏄槦鏈熷嚑


Ying-er 2010-09-08 17:32 鍙戣〃璇勮
]]>
VBA緙栫▼涔婣pplication瀵硅薄http://m.tkk7.com/crazycoding/archive/2010/09/07/331322.htmlYing-erYing-erTue, 07 Sep 2010 08:34:00 GMThttp://m.tkk7.com/crazycoding/archive/2010/09/07/331322.htmlhttp://m.tkk7.com/crazycoding/comments/331322.htmlhttp://m.tkk7.com/crazycoding/archive/2010/09/07/331322.html#Feedback0http://m.tkk7.com/crazycoding/comments/commentRss/331322.htmlhttp://m.tkk7.com/crazycoding/services/trackbacks/331322.html    Application.UserName '榪斿洖搴旂敤紼嬪簭鐨勭敤鎴峰悕
銆銆Application.Caller '榪斿洖浠h〃璋冪敤鍑芥暟鐨勫崟鍏冩牸
銆銆Application.Caller.Parent.Parent '榪斿洖璋冪敤鍑芥暟鐨勫伐浣滅翱鍚嶇О
銆銆Application.StatusBar=”璇風(fēng)瓑寰?#8230;…” '灝嗘枃鏈啓鍒扮姸鎬佹爮
銆銆Application.StatusBar=”璇風(fēng)瓑寰?#8230;…” & Percent & “% Completed” '鏇存柊鐘舵佹爮鏂囨湰錛屼互鍙橀噺Percent浠h〃瀹屾垚鐨勭櫨鍒嗘瘮
銆銆Application.StatusBar=False '灝嗙姸鎬佹爮閲嶆柊璁劇疆鎴愭甯哥姸鎬?/span>
銆銆Application.Goto Reference:=Range(“A1:D4”) '鎸囧畾鍗曞厓鏍煎尯鍩烝1鑷矰4錛岀瓑鍚屼簬閫夋嫨“緙栬緫鈥斺斿畾浣?#8221;錛屾寚瀹氬崟鍏冩牸鍖哄煙涓篈1鑷矰4錛屼笉浼?xì)鍑虹?#8220;瀹氫綅”瀵硅瘽妗?/span>
銆銆Application.Dialogs(xlDialogFormulaGoto).Show '鏄劇ず“瀹氫綅”瀵硅瘽妗嗭紝浣嗗畾浣嶆潯浠舵寜閽棤鏁?/span>
銆銆Application.Dialogs(xlDialogSelectSpecial).Show '鏄劇ず“瀹氫綅鏉′歡”瀵硅瘽妗?/span>
銆銆 Application.Dialogs(xlDialogFormatNumber).show '鏄劇ず“鍗曞厓鏍兼牸寮?#8221;涓殑“鏁板瓧”閫夐」鍗?/span>
銆銆Application.Dialogs(xlDialogAlignment).show '鏄劇ず“鍗曞厓鏍兼牸寮?#8221;涓殑“瀵歸綈”閫夐」鍗?/span>
銆銆Application.Dialogs(xlDialogFontProperties).show '鏄劇ず“鍗曞厓鏍兼牸寮?#8221;涓殑“瀛椾綋”閫夐」鍗?/span>
銆銆Application.Dialogs(xlDialogBorder).show '鏄劇ず“鍗曞厓鏍兼牸寮?#8221;涓殑“杈規(guī)”閫夐」鍗?/span>
銆銆Application.Dialogs(xlDialogPatterns).show '鏄劇ず“鍗曞厓鏍兼牸寮?#8221;涓殑“鍥炬”閫夐」鍗?/span>
銆銆Application.Dialogs(xlDialogCellProtection).show '鏄劇ず“鍗曞厓鏍兼牸寮?#8221;涓殑“淇濇姢”閫夐」鍗?/span>
銆銆娉細(xì)鏃犳硶涓嬈℃樉紺哄甫閫夐」鍗$殑“鍗曞厓鏍兼牸寮?#8221;瀵硅瘽妗嗭紝鍙兘涓嬈℃樉紺轟竴涓夐」鍗°?br /> Application.Dialogs(xlDialogFormulaGoto).show Range("b2"), True '鏄劇ず“寮曠敤浣嶇疆”鐨勯粯璁ゅ崟鍏冩牸鍖哄煙騫舵樉紺哄紩鐢ㄤ嬌鍏跺嚭鐜板湪紿楀彛宸︿笂瑙?娉細(xì)鍐呯疆瀵硅瘽妗嗗弬鏁扮殑浣跨敤)
銆銆Application.CommandBars(1).Controls(2).Controls(16).Execute '鎵ц“瀹氫綅”璇濇錛岀浉褰撲簬閫夋嫨鑿滃崟“緙栬緫鈥斺斿畾浣?#8221;鍛戒護(hù)
銆銆Application.Transpose(Array(“Sun”,”Mon”,”Tur”,”Wed”,”Thu”,”Fri”,”Sat”)) '榪斿洖涓涓瀭鐩寸殑鏁扮粍
銆銆Application.Version '榪斿洖浣跨敤鐨凟xcel鐗堟湰鍙?/span>
銆銆Application.Cursor = xlNorthwestArrow '璁劇疆鍏夋爣褰㈢姸涓哄寳瑗垮悜綆ご
銆銆Application.Cursor = xlIBeam '璁劇疆鍏夋爣褰㈢姸涓衡厾瀛楀艦
銆銆Application.Cursor = xlWait '璁劇疆鍏夋爣褰㈢姸涓烘矙婕?絳夊緟)褰?/span>
銆銆Application.Cursor = xlDefault '鎭㈠鍏夋爣鐨勯粯璁よ緗?/span>
銆銆Application.WindowState '榪斿洖紿楀彛褰撳墠鐨勭姸鎬?/span>
銆銆Application.WindowState = xlMinimized '紿楀彛鏈灝忓寲
銆銆Application.WindowState = xlMaximized '紿楀彛鏈澶у寲
銆銆Application.WindowState = xlNormal '紿楀彛姝e父鐘舵?/span>
銆銆Application.UsableHeight '鑾峰彇褰撳墠紿楀彛鐨勯珮搴?/span>
銆銆Application.UsableWidth '鑾峰彇褰撳墠紿楀彛鐨勫搴?/span>
銆銆Application.ActiveCell.Address '榪斿洖媧誨姩鍗曞厓鏍肩殑鍦板潃(娉?榪斿洖鐨勬槸緇濆鍦板潃)
銆銆Application.ActivePrinter '榪斿洖褰撳墠鎵撳嵃鏈虹殑鍚嶇О
銆銆Application.ActiveSheet.Name '榪斿洖媧誨姩宸ヤ綔琛ㄧ殑鍚嶇О
銆銆Application.ActiveWindow.Caption '榪斿洖媧誨姩紿楀彛鐨勬爣棰?/span>
銆銆Application.ActiveWorkbook.Name '榪斿洖媧誨姩宸ヤ綔綈跨殑鍚嶇О
銆銆Application.Selection.Address '榪斿洖鎵閫夊尯鍩熺殑鍦板潃
銆銆Application.ThisWorkbook.Name '榪斿洖褰撳墠宸ヤ綔綈跨殑鍚嶇О
銆銆Application.CalculationVersion '榪斿洖Excel璁$畻寮曟搸鐗堟湰(鍙寵竟鍥涗綅鏁板瓧)鍙?qiáng)Excel鐗堟湰(宸﹁竟涓や綅鏁板瓧)
銆銆Application.MemoryFree '浠ュ瓧鑺備負(fù)鍗曚綅榪斿洖Excel鍏佽浣跨敤鐨勫唴瀛樻暟(涓嶅寘鎷凡緇忎嬌鐢ㄧ殑鍐呭瓨)
銆銆Application.MemoryUsed '浠ュ瓧鑺備負(fù)鍗曚綅榪斿洖Excel褰撳墠浣跨敤鐨勫唴瀛樻暟
銆銆Application.MemoryTotal '浠ュ瓧鑺備負(fù)鍗曚綅榪斿洖Excel鍙互浣跨敤鐨勫唴瀛樻暟(鍖呮嫭宸蹭嬌鐢ㄧ殑鍐呭瓨,鏄疢emoryFree鍜孧emoryUsed鐨勬誨拰)
銆銆Application.OperatingSystem '榪斿洖鎵浣跨敤鐨勬搷浣滅郴緇熺殑鍚嶇О鍜岀増鏈?/span>
銆銆Application.OrganizationName '榪斿洖Excel浜у搧鐧昏浣跨敤鐨勭粍緇囨満鏋勭殑鍚嶇О
銆銆Application.FindFormat '鏌ユ壘鐨勬牸寮忕綾?/span>
銆銆Application.ReplaceFormat '鏇挎崲鏌ユ壘鍒扮殑鍐呭鐨勬牸寮忕綾?/span>
銆銆ActiveSheet.Cells.Replace What:=” “, _
Replacement:
=” “,SearchFormat:=True,ReplaceFormat:=True '鏇挎崲鏌ユ壘鍒扮殑鏍煎紡
銆銆Application.Interactive=False '蹇界暐閿洏鎴栭紶鏍囩殑杈撳叆
銆銆Application.Evaluate("Rate"'鑻ュ湪宸ヤ綔琛ㄤ腑瀹氫箟浜?jiǎn)甯搁?.06鐨勫悕縐頒負(fù)”Rate”,鍒欐湰璇彞灝嗚繑鍥炲?.06
銆銆Application.OnUndo “Undo Option”,“Undo Procedure” '閫夋嫨UndoOption鍚庯紝灝嗘墽琛孶ndo Procedure榪囩▼

Ying-er 2010-09-07 16:34 鍙戣〃璇勮
]]>
VBA 榪?SQLServer open鏃?鎶ラ敊錛?0040e4dhttp://m.tkk7.com/crazycoding/archive/2010/08/30/330293.htmlYing-erYing-erMon, 30 Aug 2010 07:37:00 GMThttp://m.tkk7.com/crazycoding/archive/2010/08/30/330293.htmlhttp://m.tkk7.com/crazycoding/comments/330293.htmlhttp://m.tkk7.com/crazycoding/archive/2010/08/30/330293.html#Feedback0http://m.tkk7.com/crazycoding/comments/commentRss/330293.htmlhttp://m.tkk7.com/crazycoding/services/trackbacks/330293.htmlSub SQLTest()
Dim connection As New ADODB.connection
Dim recordSet As ADODB.recordSet
Dim searchStr As String
Dim connStr As String
Dim currSheet As Worksheet
    connStr = "Provider=SQLOLEDB;Server=127.0.0.1;Database=BMS;Trusted_Connection=yes;Uid=sa;Pwd="
    connection.Open connStr
    
Set currSheet = Workbooks(1).Sheets(2)
    
Dim sqlStr As String
        sqlStr 
= "SELECT * FROM M_瀣堟煁鍍懼剶鍎?/span>"
        
Set recordSet = New ADODB.recordSet
        recordSet.Open sqlStr, connection
        
        
Dim i As Integer
        i 
= 1
        
While Not recordSet.EOF
        currSheet.Cells(i, 
1).Value = recordSet.Fields(0).Value
        currSheet.Cells(i, 
2).Value = recordSet.Fields(1).Value
        recordSet.MoveNext
        i 
= i + 1
        Wend
End Sub
鍔犱笂Trusted_Connection=yes



Ying-er 2010-08-30 15:37 鍙戣〃璇勮
]]>
VBA 瀛︿範(fàn)絎旇錛?錛?/title><link>http://m.tkk7.com/crazycoding/archive/2010/08/26/329963.html</link><dc:creator>Ying-er</dc:creator><author>Ying-er</author><pubDate>Thu, 26 Aug 2010 05:35:00 GMT</pubDate><guid>http://m.tkk7.com/crazycoding/archive/2010/08/26/329963.html</guid><wfw:comment>http://m.tkk7.com/crazycoding/comments/329963.html</wfw:comment><comments>http://m.tkk7.com/crazycoding/archive/2010/08/26/329963.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/crazycoding/comments/commentRss/329963.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/crazycoding/services/trackbacks/329963.html</trackback:ping><description><![CDATA[     鎽樿: 緋葷粺錛氭棩鏂嘩in7 褰曞埗綆鍗曠殑瀹忥紙macro錛屻優(yōu)銈儹錛?1)鎵撳紑鏂板伐浣滅翱錛岀‘璁ゅ叾浠栧伐浣滅翱宸茬粡鍏抽棴銆? Normal 0 0 2 false false false EN-US JA X-NONE MicrosoftInternetExplo...  <a href='http://m.tkk7.com/crazycoding/archive/2010/08/26/329963.html'>闃呰鍏ㄦ枃</a><img src ="http://m.tkk7.com/crazycoding/aggbug/329963.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/crazycoding/" target="_blank">Ying-er</a> 2010-08-26 13:35 <a href="http://m.tkk7.com/crazycoding/archive/2010/08/26/329963.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>感谢您访问我们的网站,您可能还对以下资源感兴趣:</p> <a href="http://m.tkk7.com/" title="亚洲av成人片在线观看">亚洲av成人片在线观看</a> <div class="friend-links"> </div> </div> </footer> 主站蜘蛛池模板: <a href="http://yuezhaoming.com" target="_blank">美女视频黄的免费视频网页 </a>| <a href="http://yuduruizhi.com" target="_blank">午夜免费福利影院</a>| <a href="http://bearsou.com" target="_blank">亚洲国产成人久久三区</a>| <a href="http://sdhuamo.com" target="_blank">亚洲一区在线免费观看</a>| <a href="http://6464k.com" target="_blank">亚洲精品亚洲人成在线观看麻豆 </a>| <a href="http://6969aaa.com" target="_blank">女人张开腿给人桶免费视频</a>| <a href="http://fantoment.com" target="_blank">亚洲av无码专区在线</a>| <a href="http://jiggybaby.com" target="_blank">黄页网站免费观看</a>| <a href="http://kj555888.com" target="_blank">在线亚洲高清揄拍自拍一品区</a>| <a href="http://dou18.com" target="_blank">91免费播放人人爽人人快乐</a>| <a href="http://www12kvkv.com" target="_blank">亚洲人成激情在线播放</a>| <a href="http://cdkunyu.com" target="_blank">欧洲黑大粗无码免费</a>| <a href="http://nmcytsi.com" target="_blank">亚洲妇女无套内射精</a>| <a href="http://an930.com" target="_blank">久久精品国产精品亚洲人人 </a>| <a href="http://blblkj.com" target="_blank">亚洲AV日韩AV永久无码绿巨人</a>| <a href="http://xamxx.com" target="_blank">久久福利青草精品资源站免费</a>| <a href="http://hs969.com" target="_blank">亚洲精品视频在线</a>| <a href="http://726zh.com" target="_blank">精品久久久久久久久免费影院</a>| <a href="http://yuduruizhi.com" target="_blank">亚洲私人无码综合久久网</a>| <a href="http://88bgbg.com" target="_blank">日韩电影免费在线</a>| <a href="http://gzmandala.com" target="_blank">人碰人碰人成人免费视频</a>| <a href="http://wxxwy.com" target="_blank">亚洲日韩精品无码专区网址</a>| <a href="http://ynxxrh.com" target="_blank">久久国产免费一区二区三区</a>| <a href="http://yy468.com" target="_blank">亚洲剧场午夜在线观看</a>| <a href="http://ittenyear.com" target="_blank">男女啪啪永久免费观看网站</a>| <a href="http://baizhengsh.com" target="_blank">无码 免费 国产在线观看91</a>| <a href="http://caocl1024liu.com" target="_blank">亚洲精品无码精品mV在线观看</a>| <a href="http://saozib.com" target="_blank">2021国内精品久久久久精免费</a>| <a href="http://kekead.com" target="_blank">亚洲一区二区三区乱码在线欧洲</a>| <a href="http://kyqp0033.com" target="_blank">国产精品四虎在线观看免费 </a>| <a href="http://czshenyue.com" target="_blank">免费又黄又爽的视频</a>| <a href="http://ningxialanh.com" target="_blank">你懂的网址免费国产</a>| <a href="http://sjmthanks.com" target="_blank">亚洲午夜精品国产电影在线观看</a>| <a href="http://14743592.com" target="_blank">四虎影院免费视频</a>| <a href="http://daohang123456.com" target="_blank">a视频在线观看免费</a>| <a href="http://milbolg.com" target="_blank">亚洲一本之道高清乱码</a>| <a href="http://nsmtv.com" target="_blank">亚洲精品无码你懂的网站</a>| <a href="http://61255555.com" target="_blank">131美女爱做免费毛片</a>| <a href="http://7a37.com" target="_blank">免费高清A级毛片在线播放</a>| <a href="http://w7768.com" target="_blank">亚洲AV无码乱码在线观看富二代</a>| <a href="http://xiaoduanfa.com" target="_blank">成年女人免费视频播放77777</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>