- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
|
¥»©«³Ì«á¥Ñ GBKEE ©ó 2012-1-11 16:40 ½s¿è
¦^´_ 1# sammay - Option Explicit
- Private Sub CommandButton1_Click()
- UserForm2.Show 1 'ªí³æ¶}±Ò¼Ò¦¡¬° 1 (±j¨î¦^À³)®É: Msgbox ´£¥X°T®§«á, ¤~·|±j¨î¦^À³¨ìªí³æ.
- 'UserForm2.Show 'ªí³æ¶}±Ò¼Ò¦¡ («D±j¨î¦^À³)
- End Sub
½Æ»s¥N½X- Option Explicit
- Dim MyClose As Boolean '¨îqªí³æ¨p¥ÎÅÜ¼Æ ¹w³]¬° False
- Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
- MyClose = True 'ªí³æÃö³¬: ÅܼÆ=True
- End Sub
- Private Sub TextBox7_Exit(ByVal Cancel As MSForms.ReturnBoolean) ' ***ªí³æÃö³¬®É¤]·|IJ°Ê¦¹µ{§Ç
- Dim Msg As String
- If MyClose = True Then Exit Sub 'ªí³æÃö³¬«á:MyClose=True
- If IsDate(TextBox7) Then '¬°¤é´Á
- If Year(TextBox7) < 2012 Or Year(TextBox7) > 2018 Then
- Msg = "¤é´Á¶·¬O 2012¦~-2018¦~"
- Else
- TextBox7 = Format(TextBox7, "YYYY/M/D") '¦p 2013/2 ->2013/2/1
- End If
- Else '«D¬°¤é´Á
- Msg = "¥²¶·¬O¤é´Á yyyy/m/d"
- End If
- If Msg <> "" Then
- Cancel = True 'Cancel = True ¤~·|¦^¨ì¦¹±±¨î¶µ
- MsgBox Msg
- With TextBox7
- .SelStart = 0 '±q0 ¶}©l¿ï¾Ü
- .SelLength = Len(.Text) '¿ï¾Üªº¦r¤¸¼Æ
- End With
- End If
- End Sub
½Æ»s¥N½X |
|