A1 ¤º®e¬° 2010/25/25
§Ú¥H¤U¦C³¯z¦¡¨Ó§PÂ_A1ªº¤ë¥÷¬O§_¬°¥¿½T®æ¦¡
If IsError(DatePart("m", Range("A1"))) = False Then
MsgBox ("µ{¦¡§Y±N¤¤Â_.")
End If
µ²ªGµ{¦¡µLªk°õ¦æ, §Ú¥H¤U¦C³¯z¦¡¨ÓÅçÃÒ Datepart("m", Range("A1")) ¬O§_¯à°õ¦æ,
MsgBox DatePart("m", Range("A2"))
µ²ªG±o¨ì Type mismatch ªº¿ù»~°T®§.
¤S·í§Ú§âA1ªº¤º®e§R°£®É(§e²{ªÅ¥ÕÄæ¦ì),§Ú¦A¥H¤U¦C³¯z¦¡ÅçÃÒ¬O§_¯à¨ú±o¼ÆÈ,
MsgBox DatePart("m", Range("A2"))
µ²ªG¶Ç¦^ 12
·Ó²z»¡,ªÅ¥ÕªºÄæ¦ì¤£¬O¨S¦³¸ê®Æ¶Ü,¬°¦ó·|¨ú±o12ªº¼ÆÈ?
¬O§_¦³¤èªk¯à¦bºI¨úA1¤ºªº¤ë¥÷¼Æ¦r«á,·í®æ¦¡¤£¹ï®É©Î¬OA1Äæ¦ìªÅ¥Õ®É,¯à±a¥X¤å¦r¤è¶ô(MsgBox)?
¥¿½T¨Ó»¡,¥ÑA1©Ò±o¨ìªºµ²ªG¥u¦³13Ó, ±q1~12 ¥H¤Î¤@Ó·í®æ¦¡¿ù»~©ÎÄæ¦ìªÅ¥Õ®É©Ò¯à±a¥X¤å¦r¤è¶ôªºÈ. |