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

½Ð±Ð VBA ¦p¦ó¤é´Á+®É¶¡Âà¤Æ¬°¤å¦r

½Ð±Ð VBA ¦p¦ó¤é´Á+®É¶¡Âà¤Æ¬°¤å¦r

Format()¥i¥H³B¸Ì®É¶¡?
1.³o¬O·Q­nªºµ²ªG>>  2020_7_16_PM_02_29_25
2.³£¥Î³o¤g¤èªk¸Ñ¨M¦Û°Ê¥t¦s³Æ¥÷ÀÉ,¥[¦bÀɦW¤¤,¦]¬°ÀɦW¤£·|­«½Æ
ActiveWorkbook.SaveAs Filename:=  ~~  & _
Replace(Date, "/", "_") & Replace(Replace(Replace(Time, ":", "_"), "¤W¤È ", "_AM_"), "¤U¤È ", "_PM_")
3.¦³¨ä¥L¤èªk?
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y

MsgBox Application.Text(Now(), "yyyy\_m\_d\_¤W¤È/¤U¤È\_hh\_mm\_ss")

TOP

¦^´_ 2# ­ã´£³¡ªL
¦¬¨ì ÁÂÁ­ã¤j
²{¦b¨S¦³¹q¸£¥i¸Õ
¬O¥Î³oºØ¤è¦¡¦bVBA¸Ì ³£¥i¥H°õ¦æ¤½¦¡±o¨ì­Èªº·N«ä¶Ü¡H¨S¥Î¹L! ©ú¤Ñ´ú¸Õ«á¦A½Ð±Ð
³o´X¦~³£¨S¤°»ò¶i¨B
¤@©Û¥b¦¡¼g¤F¤@°ï³ô¥Îªºµ{¦¡¡A¤u§@°ÝÃD¬O¸Ñ¨M¤F
¦ý¬O®Ä¯à¬O¤@¤j°ÝÃD¡A¦³¨Ç¨C¤Ñ­n°õ¦æªºµ{¦¡¤@«ö¤U¥h´N±o¶]2­Ó¦h¤p®É
¦A¦hªº²z¥Ñ ³£¬O¯î¼o¾Ç²ßªºÂǤf
½Ð¦h«ü±Ð
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y

TOP

¦^´_ 3# Andy2483

²z¸Ñ¤@ÂIÂI!
1.¨CºØ¨ç¼Æ¦bÀx¦s®æ©MVBA¸Ìªº³¯­z¤è¦¡¦³®t²§
2.VBA­n¦bÀx¦s®æ¸Ì³¯­z¤½¦¡¤è¦¡¤]¤£¦P,¦U¦³³W«h
ÁÂÁÂ

Sub test_20200807_7()
MsgBox Application.ExecuteExcel4Macro("numberstring(123456789,2)")
[A1] = "=numberstring(123456789,2)"
MsgBox [A1].Value

MsgBox Application.Text(Now(), "yyyy\_m\_d\_AM/PM\_hh\_mm\_ss")
[A1] = "=TEXT(NOW(), ""yyyy" & "\" & "_m" & "\" & "_d" & "\" & "_AM/PM" & "\" & "_hh" & "\" & "_mm" & "\" & "_ss"")"
MsgBox [A1]

MsgBox Application.Sum([A2:A10])
[A1] = "=Sum(A2:A10)"
MsgBox [A1]
End Sub
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y

TOP

¦^´_ 4# Andy2483


[A1] = "=Text(Now(), ""yyyy\_m\_d\_¤W¤È/¤U¤È\_hh\_mm\_ss"")"

TOP

¦^´_ 5# ­ã´£³¡ªL

§Ñ¤F¿ý»s¥¨¶°´N¥i¥H¤Ï±À±o¨ìµ{¦¡½X, «¢ :L  ¦ý¬O­n¥ý·|¼g¤½¦¡!
ÁÂÁÂ
Sub test_20200807_9()
[A1] = "=TEXT(NOW(), ""¤µ¤Ñ¬Oaaaa_yyyy\_mm\_dddd\_¤W¤È/¤U¤È\_hh\_mm\_ss"")"
MsgBox [A1]

[B2] = "¤µ¤Ñ¬O"
[A1] = "=TEXT(NOW(), R[1]C[1]&""aaaa_yyyy\_mm\_dddd\_¤W¤È/¤U¤È\_hh\_mm\_ss"")"
MsgBox [A1]
End Sub
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y

TOP

        ÀR«ä¦Û¦b : ¤@­Ó¤H¤£©È¿ù¡A´N©È¤£§ï¹L¡A§ï¹L¨Ã¤£Ãø¡C
ªð¦^¦Cªí ¤W¤@¥DÃD