¦p¦ó§Q¥ÎVBA¥hÅçÃÒ ªí³æ¤W±ªºÄæ¦ìÄÝ©Ê
- ©«¤l
- 103
- ¥DÃD
- 30
- ºëµØ
- 0
- ¿n¤À
- 139
- ÂI¦W
- 0
- §@·~¨t²Î
- wondows XP
- ³nÅ骩¥»
- office 2007
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¹ü¤Æ
- µù¥U®É¶¡
- 2013-2-21
- ³Ì«áµn¿ý
- 2015-6-26
|
¦p¦ó§Q¥ÎVBA¥hÅçÃÒ ªí³æ¤W±ªºÄæ¦ìÄÝ©Ê
·Q½Ð°Ý¤@¤U¤j¤j
¦pªG·QnÅçÃÒ¿é¤JªºÄæ¦ì¡G
1. ¿é¤J¤º®e¥²¶·¬°¤é´Á¡C
2. «ü©w¿é¤Jªº®É¶¡¥²¶·¬°2013/1/1 ~ 2013/12/31¡C
3. ¦pªG¿é¤J8/8¡A·|¦Û°Ê§ó·s¬°2013/8/8¡C
§Ú¥Î¿ý»s¾Þ§@ªºµ{¦¡½X- Sub Macro14()
- '
- ' Macro14 Macro
- '
- '
- With Selection.Validation
- .Delete
- .Add Type:=xlValidateDate, AlertStyle:=xlValidAlertStop, Operator:= _
- xlBetween, Formula1:="1/31/2013", Formula2:="12/31/2013"
- .IgnoreBlank = True
- .InCellDropdown = True
- .InputTitle = ""
- .ErrorTitle = "½Ð¿é¤J¥¿½Tªº®æ¦¡"
- .InputMessage = ""
- .ErrorMessage = _
- "1.±z¿é¤Jªº¤£¬O¤é´Á¡C" & Chr(10) & "2.±zªº¤é´Á®æ¦¡¿ù»~¡A¥¿½T³W®æ¬°YYYY/MM/DD¡C" &Chr(10) & "3.±z¿é¤Jªº¤é´Á¥¼¤¶©ó2013/1/1~2013/12/31¤§¶¡¡C" &Chr(10) &""
- .IMEMode = xlIMEModeOff
- .ShowInput = True
- .ShowError = True
- End With
- End Sub
½Æ»s¥N½X ¦ý¬On«ç»òקï©ñ¦bªí³æ¸Ì±©O?
§Æ±æ¤j¤j«ü¾É¤@¤U >< |
|
Jared
|
|
|
|
|
- ©«¤l
- 103
- ¥DÃD
- 30
- ºëµØ
- 0
- ¿n¤À
- 139
- ÂI¦W
- 0
- §@·~¨t²Î
- wondows XP
- ³nÅ骩¥»
- office 2007
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¹ü¤Æ
- µù¥U®É¶¡
- 2013-2-21
- ³Ì«áµn¿ý
- 2015-6-26
|
¦^´_ 4# stillfish00
^^ ÁÂÁ¤j¤jªº¸Ñµª
§Úª¾¹D¤F |
|
Jared
|
|
|
|
|
- ©«¤l
- 1018
- ¥DÃD
- 15
- ºëµØ
- 0
- ¿n¤À
- 1058
- ÂI¦W
- 0
- §@·~¨t²Î
- win7 32bit
- ³nÅ骩¥»
- Office 2016 64-bit
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ®ç¶é
- µù¥U®É¶¡
- 2012-5-9
- ³Ì«áµn¿ý
- 2022-9-28
|
¦^´_ 3# Jared
TextBox1 : ªí³æ¤W¥Î¨Ó¿é¤J¤é´Áªº¤å¦r¤è¶ô
TextBox1_Exit : ¸Ó¤å¦r¤è¶ôªºExit¨Æ¥ó¡Aªí¥Ü·í¨Ï¥ÎªÌ¥´§¹¤é´Á«á«ötab©ÎenterÂ÷¶}¸Ó¤å¦r¤è¶ô®É·|¦Û¤vIJµo¡A°Ñ¼Æªºcancel¥i³]©w¨Ï¨ä¤£¥¢¥h¾nÂI(¤å¦r´å¼Ð¯d¦b¸Ó¤å¦r¤è¶ô)¡C
«e±ªºCoden©ñ¦b¸Óªí³æªºµ{¦¡½X¶±¡C |
|
|
|
|
|
|
- ©«¤l
- 103
- ¥DÃD
- 30
- ºëµØ
- 0
- ¿n¤À
- 139
- ÂI¦W
- 0
- §@·~¨t²Î
- wondows XP
- ³nÅ骩¥»
- office 2007
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¹ü¤Æ
- µù¥U®É¶¡
- 2013-2-21
- ³Ì«áµn¿ý
- 2015-6-26
|
¦^´_ 2# stillfish00
·PÁ¤j¤jªº¨ó§U ^^
·Q½Ð°Ý¤@¤U¤j¤j
ÅçÃÒ¤é´Á ¥²¶·¥]ÂЦb Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
³oÓµ{¦¡½XªºÄݩʤU±¶Ü? (@@) |
|
Jared
|
|
|
|
|
- ©«¤l
- 1018
- ¥DÃD
- 15
- ºëµØ
- 0
- ¿n¤À
- 1058
- ÂI¦W
- 0
- §@·~¨t²Î
- win7 32bit
- ³nÅ骩¥»
- Office 2016 64-bit
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ®ç¶é
- µù¥U®É¶¡
- 2012-5-9
- ³Ì«áµn¿ý
- 2022-9-28
|
¦^´_ 1# Jared - Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
- Const START_DATE = "2013/1/1"
- Const END_DATE = "2013/12/31"
-
- If TextBox1 = vbNullString Then Exit Sub '¥¼¶ñ©¿²¤
-
- If IsDate(TextBox1) Then
- If CDate(TextBox1) > DateValue(START_DATE) And CDate(TextBox1) < DateValue(END_DATE) Then
- TextBox1 = Format(TextBox1, "yyyy/m/d")
- Else
- MsgBox "±z¿é¤Jªº¤é´Á¥¼¤¶©ó" & START_DATE & "~" & END_DATE & "¤§¶¡¡C"
- Cancel = True
- End If
- Else
- MsgBox "±zªº¤é´Á®æ¦¡¿ù»~¡A¥¿½T³W®æ¬°YYYY/MM/DD¡C"
- Cancel = True
- End If
- End Sub
½Æ»s¥N½X |
|
|
|
|
|
|