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

[µo°Ý] VB§ó§ïwin10¨t²Î®É¶¡,Åv­­°ÝÃD

[µo°Ý] VB§ó§ïwin10¨t²Î®É¶¡,Åv­­°ÝÃD

¤U­±µ{¦¡½X,¦bWin7¨t²Î°õ¦æ¨S¦³°ÝÃD,¦ý¦p¦bWin10¨t²Î°õ¦æ·|¥X²{¤U¹Ï¿ù»~
½Ð±Ð¤j¤j,¦¹°ÝÃD­n«ç»ò¸Ñ¨M

Date = DateAdd("m", 1, Date) '¤é´Á + 1­Ó¤ë

¦^´_ 1# blue2263
  1.    Date = DateAdd("m", 1, Date)     '  ¤é´Á + 1­Ó¤ë
½Æ»s¥N½X
¦]¬° Date ¬°¨t²Î¤§¤º¦b¨ç¼Æ¡A
¬O¤£¤¹³\¨Ï¥ÎªÌ¥ô·N§ó°Êªº¡C
P.S.  "Date" ¬°¨t²Î¤§«O¯d¦r (Reserved Word)¡F
¦ý¦pªG­×§ï¬°¡G
  1.    dd = DateAdd("m", 1, Date)     '  ¤é´Á + 1­Ó¤ë
½Æ»s¥N½X
«h¬O OK ªº¡C

TOP

¦^´_ 2# c_c_lai
C¤j§A¦n
°ÝÃD¬O,§Ú¦bWin7¨t²Î°õ¦æ¨S°ÝÃD,¦ý¦bWin10¨t²Î¤W,·|¥X²{¿ù»~
¤£ª¾¦³¨S¦³§ó§ïWin10Åv­­ªº¤èªk?

TOP

¥»©«³Ì«á¥Ñ c_c_lai ©ó 2016-11-6 07:54 ½s¿è

¦^´_ 3# blue2263
¤@¼Ë¬O¨Ï¥Î¦P¤@ Office ª©¥»¡H
§Ú¬O¥Î Office 2010¡A¤@´ú«K¦p¦P§Aµo¥Íªº°T®§¡C
¾Ú§Ú©Òª¾  Office 2010 »yªkÀˬd¤ñ¸ûÄYÂÔ¡A¥¦ªº
«O¯d¦r©Î¤º¦b²[¦¡¬O¤£¯à·íÅܼƨϥή³¨Ó³Q Assign ­Èªº¡C
»P Windows  ª©¥»µLÃö¡C
(¨S¦³§ó§ïÅv­­ «üªº´N¬O¥H¤Wªº¸Ñ»¡)

TOP

¦^´_ 4# c_c_lai
§Ú¥Îªº¤]¬Ooffice2010
(¨S¦³§ó§ïÅv­­),¤F¸ÑÁÂÁÂ
·PÁÂC¤j¸Ñµª

TOP

¥»©«³Ì«á¥Ñ c_c_lai ©ó 2016-11-6 09:54 ½s¿è

¦^´_ 5# blue2263
³o¤T­Ó¨Ò¤l¡A§A¥Î F8 ¥h°õ¦æ¡A«K¥iÆ[¹î¥X¨Ó¡G
  1. Sub Ex()
  2.    Date = DateAdd("m", 1, Date)     '  ¤é´Á + 1­Ó¤ë
  3.    MsgBox Date
  4. End Sub
½Æ»s¥N½X
  1. Sub Ex2()
  2.    Dim Date

  3.    Date = DateAdd("m", 1, Date)     '  ¤é´Á + 1­Ó¤ë
  4.    MsgBox Date
  5. End Sub
½Æ»s¥N½X
°ò¥»¤W¡A¤W¨â­Ó¥Îªk¦b¥¿³Wªºµ{¦¡ÅÞ¿è»yªkÀ³¥Î¤W¬O¤£³Q¤¹³\ªº¡A
³o¤]¬O VB ¥»¨­ªº»yªkº|¬}¡A¨ì¤F Windows 10 ¤º³¡§@·~¨t²Îµ{¦¡®w
§Y±N¥¦¸É¥¿¤F¡C
  1. Sub Ex3()
  2.    Dim dd

  3.    dd = DateAdd("m", 1, Date)     '  ¤é´Á + 1­Ó¤ë
  4.    MsgBox dd       '  ¥ç¬°¤é´Á«¬ºA
  5. End Sub
½Æ»s¥N½X

TOP

¦^´_ 6# c_c_lai
­ì¨Ó¦p¦¹,¤F¸Ñ¤F
ÁÂÁÂC¤j¸Ñµª

TOP

¥»©«³Ì«á¥Ñ jackyq ©ó 2016-11-6 15:53 ½s¿è

VBA.Date  ¥»¨­´N¬O³Q³]­p¦¨¥i¥H±µ¨ü½á­Èªº

https://msdn.microsoft.com/en-us/library/office/gg278644.aspx

(1) ¦^¶Ç¨t²Î®É¶¡
Returns a Variant (Date) containing the current system date.

(2) ³]©w¨t²Î®É¶¡ ( ©Ò¥H¬O¥i¥H±µ¨ü  Date = DateAdd("m", 1, Date)  ªº¼gªk  )
To set the system date, use the Date statement.

TOP

        ÀR«ä¦Û¦b : ¦Û¤v®`¦Û¤v¡A²ö¹L©ó¶ÃµoµÊ®ð¡C
ªð¦^¦Cªí ¤W¤@¥DÃD