ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] EXCEL VBA ¥Ñ­pºâ»¡©ú­pºâª÷ÃB(¤G)

[µo°Ý] EXCEL VBA ¥Ñ­pºâ»¡©ú­pºâª÷ÃB(¤G)

­ìµo°Ý¦p¤U¡A¬O§Q¥Î§R°£¦r¦ê¨Ó§R°£³¡¥²­nªº¦r¤¸
http://forum.twbts.com/thread-7705-1-1.html

¦]¬°«e¤è¦¡ÁÙ¤£¬O«Ü¤è«K¨Ï¥Î¡A§Æ±æ³]©w²³æ³W«h¨Ó§R°£¤£¥²­nªº¦r¤¸©Î¬O«O¯d¥²­nªº¦r¤¸
CÄæ­pºâ»¡©ú¤¤¡A¥u­n«O¯d ¼Æ¦r 0-9¡A¹Bºâ²Å¸¹ + - * / ^ % ¡A¬A¸¹ ( ), ­^¤å a-z A-Z ¨ä¥L§R°£¡A
§R°£«á·|Åܦ¨¼Ð·Ç­pºâ¦¡¡A¦A­pºâ¦¡©ñ¤JDÄæª÷ÃBÄæ¡A¬°¤F¤è«KÀˬd¥¿½T©Ê¡A¥i§_¥H¤½¦¡¤è¦¡©ñ¤J¡C




ÀÉ®× EXCEL VBA ­pºâ»¡©úÂàª÷ÃB(¤G).rar (5.99 KB)
{...} ªí¥Ü»Ý­n¥Î CTRL+SHIFT+ENTER ¤TÁä¿é¤J¤½¦¡

¦^´_ 11# ML089
¤@­Ó¬O±a¤J¤½¦¡¡B¥t¤@­Óª½±µ´«ºâ¬°­È¡A
³£¬OÆZ¤£¿ù¥B²³æªº³B²z¤è¦¡¡C

TOP

¦^´_ 9# c_c_lai

ÁÂÁ§A´£¨Ñ¡A¦b¬Ý§Aªº¤½¦¡®É¡A¤]Åý§Ú·Q¨ì¥t¤@ºØ²³æ¼gªk(¦CÁ|ªk)
Function MyCal(MyStr$) As Double
    Dim Dic As String, xStr As String
    Dic = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.0123456789%+-*/^()"
    For i = 1 To Len(MyStr)
        If InStrB(1, Dic, Mid(MyStr, i, 1), 1) <> 0 Then
            xStr = xStr & Mid(MyStr, i, 1)
        End If
    Next i
    MyCal = Evaluate(xStr)
End Function
{...} ªí¥Ü»Ý­n¥Î CTRL+SHIFT+ENTER ¤TÁä¿é¤J¤½¦¡

TOP

¦^´_ 8# chin15

»¡©ú²M·¡¡A·PÁ§A¡A¤SÅý§Ú¦h¾Ç¤F¦n´X©Û¡A¦Aµ¹§A¤@­Ó Æg
{...} ªí¥Ü»Ý­n¥Î CTRL+SHIFT+ENTER ¤TÁä¿é¤J¤½¦¡

TOP

¦^´_ 1# ML089
´£¨Ñ§A°Ñ¦Ò¡C
  1. Function decodeFMT(decode As String) As String
  2.     Dim tLen%, txt$, num$
  3.    
  4.     If Len(decode) = 0 Then decodeFMT = "": Exit Function
  5.     num = "=Sum("
  6.     For tLen = 1 To Len(decode)
  7.            txt = Mid(decode, tLen, 1)
  8.            If txt = "(" Or txt = ")" Or txt = "+" Or txt = "+" Or txt = "+" Or txt = "-" Or txt = "*" Or txt = "/" Or (txt >= "0" And txt <= "9") Then
  9.                 num = num + txt
  10.            End If
  11.     Next tLen
  12.     decodeFMT = num + ")"
  13. End Function
½Æ»s¥N½X
EXCEL VBA ­pºâ»¡©úÂàª÷ÃB.rar (9.07 KB)

TOP

http://www.dotblogs.com.tw/yc421206/archive/2008/12/14/6386.aspx

TOP

¦^´_ 6# chin15
«z! ¨Ï¥Î CreateObject("VBSCRIPT.REGEXP") Åýµ{¦¡½X§óµu¡A¯u¼F®`
ÁöµM¬Ý¤£À´¡AÁÙ¬O¥ýµ¹¤@­ÓÆg
EXCEL¸Ì§ä¤£¨ì»¡©ú¡Aºô¸ô³£¬O¨Ò¤l§ä¤£¨ì§¹¾ã»¡©ú¡A¤£ª¾­þ¸Ì¦³»¡©ú¥i¥H¬Ý¡A¥i§_§iª¾ ¤@¤U¡C
{...} ªí¥Ü»Ý­n¥Î CTRL+SHIFT+ENTER ¤TÁä¿é¤J¤½¦¡

TOP

EXCEL VBA ­pºâ»¡©úÂàª÷ÃB(¤G).rar (7.58 KB)
1

µû¤À¤H¼Æ

    • Hsieh: µ¹§A¤@­ÓÆg!ª÷¿ú + 2

TOP

¦^´_ 4# Hsieh

·PÁ¦^ÂÐ

¦bEXCEL¬O¥ÎCODE¡Aº¸¥B½X¬O¥¿¼Æ5¦ì
¦bVBA¬O¥ÎASC¡Aº¸¥B½X¬O­t¼Æ5¦ì
VBAªºASC»PEXCELªºASC¬O¤£¦P·N¸q¡A
EXCELªº¨ç¼Æ»PVBAªº¨ç¼Æ¤£¦P¦W¥Îªk¤]¤£¦P¡A¾Ç²ß°_¨Ó¯u¬Oµh­W¡C
{...} ªí¥Ü»Ý­n¥Î CTRL+SHIFT+ENTER ¤TÁä¿é¤J¤½¦¡

TOP

¦^´_ 3# ML089
§PÂ_¬O§_¬°º~¦r¡A¥i§Q¥ÎASC¨ç¼Æ¨ú±o¦r¤¸½X¡A¤p©ó0«h¬°º~¦r
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

        ÀR«ä¦Û¦b : ¹ï¤÷¥À­nª¾®¦¡A·P®¦¡B³ø®¦¡C
ªð¦^¦Cªí ¤W¤@¥DÃD