¼ÐÃD:
[µo°Ý]
°}¦C¤Î¥t¤@Ó¤p°ÝÃD(¤w¸Ñ¨M)
[¥´¦L¥»¶]
§@ªÌ:
icestormer
®É¶¡:
2012-4-22 13:30
¼ÐÃD:
°}¦C¤Î¥t¤@Ó¤p°ÝÃD(¤w¸Ñ¨M)
¥»©«³Ì«á¥Ñ icestormer ©ó 2012-5-3 09:33 ½s¿è
쥻·Qªk¬O ·ín³]©w®æ¦¡®É¥ý©I¥s ¸ê®Æ®æ¦¡§PÂ_ °Æµ{¦¡ §Ë¦¨°}¦C«á ¦^¶Ç
µM«á®Ú¾Ú°}¦C¤ºªº(¥Ñ0 -3)¤£¦P¼Æ¦r¨Ó¹ï¸ê®Æ¾ãÄæ¶i¦æ¤£¦Pªº®æ¦¡¤Æ
-------------------------------------------------------------------------------
§Ú¬O·Q»¡ ¥i¤£¥i¥H§â
¸ê®Æ®æ¦¡§PÂ_
³oӰƵ{¦¡
¥Ñ private sub workbook_open() ¦b¥´¶}EXCEL®É´N¥ý°µ¦n
µM«á ·í
§PÂ_¸ê®Æ®æ¦¡_1()»Ýn¥Îmydata()¤ºªº¸ê®Æ®É´N®³¨Ó¨Ï¥Î
¦Ó¤£¥În¶]¤@¦¸®É´N¥h°õ¦æ¤@¦¸¸ê®Æ®æ¦¡§PÂ_?
¤£ª¾¹D¯à¤£¯à·Ó§Ú»¡ªº³o¼Ë§ï©OÁÙ¬O¤@©wnn¥Î®É´N±o¥h°õ¦æ¤@¦¸¨ú±o°}¦CªºÈ¨Ã¦^¶Ç ÁÂÁÂÀ°¦£
¥t¥~°Ý¤p¤p°ÝÃD. §Ú·Q§Q¥Î¥H¤Uµ{¦¡½XÃö±¼EXCEL(¾ãÓÃö±¼)
¤£ºÞ§Ú¬O±Ä¥ÎThisWorkbook.Close ©Î¬OApplication.Quit©Î¬O ActiveWindow.Close ÁÙ¬O¤TÓ¤@°_¥Î..³£¨Sªk¾ãÓÃö³¬EXCEL
Application.DisplayAlerts = False
ThisWorkbook.Close
Application.Quit
ActiveWindow.Close
Application.DisplayAlerts = true
³o¬O¹Ï¤ù³sµ²,¤Wz«ü¥O¥u·|ÃöÃöactiveworkbook¦Ó¤w,³o¬O¬°¤°»ò©O?§Ú¬O·Qn§â¥¦§¹§¹¾ã¾ãªºÃö³¬ ´N¦n¹³§A¨S¦³¥´¶}EXCEL¤@¼Ë
[attach]10574[/attach]
§@ªÌ:
register313
®É¶¡:
2012-4-22 14:34
¦^´_
1#
icestormer
1.²¤Æ¤@¤U
Sub ³]©w®æ¦¡()
Dim mydata()
³Ì«á¸ê®Æ¦æ = [A5].End(xlDown).Row
¸ê®Æªø«× = [A5].End(xlToRight).Column
ReDim mydata(¸ê®Æªø«×)
For i = 1 To ¸ê®Æªø«×
Set Rng = Range("A6:A" & ³Ì«á¸ê®Æ¦æ).Offset(0, i - 1)
Select Case Left(Cells(5, i), 1)
Case "%"
mydata(i) = 2
Rng.NumberFormatLocal = "0.00%"
Case "$"
mydata(i) = 1
Rng.NumberFormatLocal = "$#,##0.00"
Case "§A"
mydata(i) = 3
Rng.NumberFormatLocal = "G/³q¥Î®æ¦¡"
Case Else
mydata(i) = 0
Rng.NumberFormatLocal = "#,##0.00_ "
End Select
Next
End Sub
½Æ»s¥N½X
2.Application.Quit
§@ªÌ:
c_c_lai
®É¶¡:
2012-4-22 14:59
¦^´_
2#
register313
½Ð±Ð¤@¤U¡A±z¦bµ{¦¡ùثŧi¤F
Dim mydata() ¬°¦ó±µµÛ¤S«Å§i¤@¦¸ ReDim mydata(¸ê®Æªø«×)¡A¨ä¥Î·N¦ó¦b¡H
ÁÂÁ±z¡I
§@ªÌ:
GBKEE
®É¶¡:
2012-4-22 15:43
¦^´_
3#
c_c_lai
ReDim ³¯z¦¡ ¦bµ{§Ç¼h¦¸¤¤¥Î¨Ó«·s°t¸m°ÊºA°}¦CÅܼƪºÀx¦sªÅ¶¡¡C ¥i¬d¬ÝVba ªº»¡©ú
Dim mydata() ¬°°ÊºA°}¦C
¶i¤Jµ{§Ç«á¥i¥H ¨Ì©Ò»Ý¦A¦¸«Å§i°}¦C¤¸¯Àªø«×
ReDim mydata(¸ê®Æªø«×)
§@ªÌ:
register313
®É¶¡:
2012-4-22 15:45
Sub ³]©w®æ¦¡()
³Ì«á¸ê®Æ¦æ = [A5].End(xlDown).Row
¸ê®Æªø«× = [A5].End(xlToRight).Column
For i = 1 To ¸ê®Æªø«×
Set Rng = Range("A6:A" & ³Ì«á¸ê®Æ¦æ).Offset(0, i - 1)
Select Case Left(Cells(5, i), 1)
Case "%"
Rng.NumberFormatLocal = "0.00%"
Case "$"
Rng.NumberFormatLocal = "$#,##0.00"
Case "§A"
Rng.NumberFormatLocal = "G/³q¥Î®æ¦¡"
Case Else
Rng.NumberFormatLocal = "#,##0.00_ "
End Select
Next
End Sub
½Æ»s¥N½X
§@ªÌ:
icestormer
®É¶¡:
2012-4-22 20:44
¦^´_
3#
c_c_lai
¦p¦PGBKEE¤j¸Ñ»¡¤@¼Ë
¥Î¦b°}¦Cªø«×¥i¯à·|Åܰʪº±¡ªp¤U ³o¼gªk «Ü¤è«K^^
§@ªÌ:
icestormer
®É¶¡:
2012-4-22 20:47
¥»©«³Ì«á¥Ñ icestormer ©ó 2012-4-22 20:56 ½s¿è
¦^´_
5#
register313
·PÁ§AªºÀ°¦£ ¨Ó¸Õ¬Ý¬Ý^^
½Ð°Ý §Ú¥Î¤Fapplication.quit ¬O¥i¥Hª½±µÃö±¼EXCEL¦ýÃö¤§荝ÁÙ¬O·|°Ý§Ún¤£n¦sÀÉ
¨Ï¥Î application.displayalerts=false «ç·|¨S¦³§@¥Î©O?(¤£·Q³Q°Ý¨ì¦³¨S¦³n¦sÀÉ´N©y±µÃö³¬EXCEL)
application.displayalerts=false
application.quit
application.displayalerts=true
§@ªÌ:
Hsieh
®É¶¡:
2012-4-22 21:56
¦^´_
7#
icestormer
ThisWorkbook.Save
Application.Quit
Åwªï¥úÁ{ ³Â»¶®a±Ú°Q½×ª©ª© (http://forum.twbts.com/)