TextBox¦p¦ó³]©w¥u¯à¬O¾ã¼Æ?
- ©«¤l
- 132
- ¥DÃD
- 56
- ºëµØ
- 0
- ¿n¤À
- 190
- ÂI¦W
- 0
- §@·~¨t²Î
- Win10
- ³nÅ骩¥»
- Office 365
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-5-17
- ³Ì«áµn¿ý
- 2024-4-29
|
TextBox¦p¦ó³]©w¥u¯à¬O¾ã¼Æ?
§Ú³]p¤@Óªí³æ ¨ä¤¤TextBox§@¬°¿é¤J¤¶± ¥Ñ©ó¸Ó°Ñ¼Æ¥²¶·¬°¥¿¾ã¼Æ¸Ó¦p¦ó¨îTextBox¤§®æ¦¡
§Ú§Æ±æ¼g¦¨·í¿é¤J¬°¥¿¾ã¼Æ¥H¥~¦r¤¸«hÅã¥Ü"¥²¶·¬°¥¿¾ã¼Æ"
ÁÂÁÂ |
|
|
|
|
|
|
- ©«¤l
- 132
- ¥DÃD
- 56
- ºëµØ
- 0
- ¿n¤À
- 190
- ÂI¦W
- 0
- §@·~¨t²Î
- Win10
- ³nÅ骩¥»
- Office 365
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-5-17
- ³Ì«áµn¿ý
- 2024-4-29
|
¸Ó¼gªkÁöµM¥i¥H¸Ñ¨M«D¾ã¼Æªº°ÝÃD ¦ý¦pªG¹J¨ì¨Ï¥ÎªÌ¿é¤J¼Æ¦r¥H¥~¦r¤¸¨Ò¦p"h","¦n"
¸Ó¦p¦óÅýµ{¦¡¦Û°Ê§P§O³o¨Ç«D¼Æ¦r¦r¤¸¤Î¦Û°Ê¸õ¥X¦Ó¤£Pµo¥Íµ{¦¡¿ù»~? |
|
|
|
|
|
|
- ©«¤l
- 2035
- ¥DÃD
- 24
- ºëµØ
- 0
- ¿n¤À
- 2031
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7
- ³nÅ骩¥»
- Office2010
- ¾\ŪÅv
- 100
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-3-22
- ³Ì«áµn¿ý
- 2024-2-1
|
¦^´_ 3# acdx
TextBox1 = "" ¤w¸gµ¹§Aµª®×¤F¡I |
|
|
|
|
|
|
- ©«¤l
- 132
- ¥DÃD
- 56
- ºëµØ
- 0
- ¿n¤À
- 190
- ÂI¦W
- 0
- §@·~¨t²Î
- Win10
- ³nÅ骩¥»
- Office 365
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-5-17
- ³Ì«áµn¿ý
- 2024-4-29
|
¦^´_ 4# c_c_lai
¤£¦n·N«ä §Ú¤W±¥i¯à¨Sªí¹F²M·¡
²{¦b¹J¨ìªº°ÝÃD¬OTextBox©Ò¿é¤JªºÈ³Q»{©w¬°¤å¦r
°²³]§Ú¿é¤J5 «hTextBox="5"(¥ÑºÊ¬Ý¦¡¸Ì¬Ý¨ìªºÈ) ¦ÓTextBox¦bµ{¦¡¤¤¥²¶·¬O¥¿¾ã¼Æ¤~¥i¥¿±`°õ¦æ §Ú§Æ±æ§Úªºµ{¦¡¯à°÷§P§O/´£¿ô¨Ï¥ÎªÌ¡A·íTextBox¿é¤J¬°t¼Æ©Î¤p¼Æ®É«h·|¥X²{ĵ§iµøµ¡¦]¦¹§Ú¼g¦¨³o¼Ë: (·íTextBox1¿é¤J8,TextBox2¿é¤J12)
If IsNumeric(TextBox1) = False Or IsNumeric(TextBox2) = False Then
MsgBox "½Ð¿é¤J¼Æ¦r"
Exit Sub
ElseIf TextBox1 <> Abs(Int(TextBox1)) Or TextBox2 <> Abs(Int(TextBox2)) Then
MsgBox "½Ð¿é¤J¾ã¼Æ"
Exit SubEnd If
ÂŦ⬰¨ä°õ¦æµ²ªG
¥ÑºÊ¬Ý¦¡¸Ì: TextBox1="8", Abs(Int(TextBox1)) =8, TextBox2 ="12", Abs(Int(TextBox2)) =12
¬G:TextBox1 ¤£µ¥©óAbs(Int(TextBox1)) ©Ò¥Hµ{¦¡¸õ¶}-->³o¸Ó¦p¦ó¸Ñ¨M?
¥t¥~µ{¦¡¤¤¥²¶·TextBox1<TextBox2©Ò¥H§ÚÁÙ¼g¤F±ø¥ó¦¡½T«O³oÃö«Y¦¨¥ß¦ý«o³Q§PÂ_¬° "8">"12"-->©Ò¥Hµ{¦¡¤S¸õ¶} ³o¨Ç°ÝÃD§xÂZ§Ú¦n´X¤Ñ¤F |
|
|
|
|
|
|
- ©«¤l
- 2035
- ¥DÃD
- 24
- ºëµØ
- 0
- ¿n¤À
- 2031
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7
- ³nÅ骩¥»
- Office2010
- ¾\ŪÅv
- 100
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-3-22
- ³Ì«áµn¿ý
- 2024-2-1
|
¦^´_ 5# acdx - Sub Test()
- ' °²³] [B1] Äæ¦ìÄݩʬ°¤å¦r¡F¿é¤JÈ: 10¡B©Î¬O 10ABC
- ' «h¦¹®É [B1] ¬° Not IsNumeric([B1])
- If IsNumeric([B1]) Then
- [B3] = Abs(Int([B1]))
- Else
- If Val([A1]) > 0 Then
- [B3] = Abs(Int(Val([B1]))) ' ¨ú±o¼ÆÈ 10
- Else
- [B3] = "" ' ¸ÓÄæ¦ìȬ°«D¼ÆȤ§¤å¦r¦ê
- MsgBox "½Ð¿é¤J¼Æ¦r"
- End If
- End If
- End Sub
½Æ»s¥N½X ¦p¦¹Á|¨Ò¡A¤F¸Ñ§_¡H |
|
|
|
|
|
|
- ©«¤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
|
¦^´_ 5# acdx - Option Explicit
- Dim Msg As Boolean '¹w³]È: False
- Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
- Msg = True 'ªí³æÃö³¬:ÅܼƳ]©w
- End Sub
- Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean) 'ªí³æÃö³¬«áÁÙ·|°õ¦æ¦¹µ{¦¡
- If Msg = False Then If TextÀˬd(TextBox1) Then Cancel = True
- 'Cancel: False ªí¥Ü±±¨î¶µ¤£³B²z¨Æ¥ó¡]¹w³]¡^¡FTrue ªí¥ÜÀ³¥Îµ{¦¡¶·³B²z¦¹¨Æ¥ó¡A¥B¾nÂI¤´«O¯d¦b¥Ø«e±±¨î¶µ¡C
- End Sub
- Private Sub TextBox2_Exit(ByVal Cancel As MSForms.ReturnBoolean)
- If Msg = False Then If TextÀˬd(TextBox2) Then Cancel = True
- End Sub
- '¦pÁÙ¦³TextBox ¨Ì¼Ëµe¸¬Äª
- 'Private Sub TextBox3_Exit(ByVal Cancel As MSForms.ReturnBoolean)
- ' If Msg = False Then If TextÀˬd(TextBox3) Then Cancel = True
- 'End Sub
- Private Function TextÀˬd(Box As MSForms.TextBox) As Boolean
- Dim S As Integer
- If Abs((Int(Val(Box))) <> Box Or Box < 0) Then
- S = InStr(Box, ".")
- Box.SelStart = IIf(Mid(Box, 1, 1) = "-", 0, S - IIf(S > 0, 1, 0))
- Box.SelLength = IIf(Mid(Box, 1, 1) = "-", 1, Len(Box) - S + 1)
- MsgBox "»Ý¿é¤J¥¿¾ã¼Æ"
- TextÀˬd = True
- End If
- End Function
½Æ»s¥N½X |
|
|
|
|
|
|
- ©«¤l
- 132
- ¥DÃD
- 56
- ºëµØ
- 0
- ¿n¤À
- 190
- ÂI¦W
- 0
- §@·~¨t²Î
- Win10
- ³nÅ骩¥»
- Office 365
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-5-17
- ³Ì«áµn¿ý
- 2024-4-29
|
|
|
|
|
|
|