Excel VBA ¥Îtextbox·s¼Wªí³æ¸ê®Æ°ÝÃD
- ©«¤l
- 4
- ¥DÃD
- 1
- ºëµØ
- 0
- ¿n¤À
- 5
- ÂI¦W
- 0
- §@·~¨t²Î
- Office
- ³nÅ骩¥»
- 2010
- ¾\ŪÅv
- 10
- µù¥U®É¶¡
- 2016-4-10
- ³Ì«áµn¿ý
- 2016-7-11
|
Excel VBA ¥Îtextbox·s¼Wªí³æ¸ê®Æ°ÝÃD
¤j®a¦n~
³Ìªñ¤~¶}©l¾Ç²ßVBA¡A·Qn³]ptextbox¨Ó·s¼Wªí³æ¸ê®Æ¡A¥Ø«e¼gªºµ{§Ç¥i¥H°õ¦æ¡A¦ý¬O³£·|»\±¼²Ä¤@¦Cªº¼ÐÃDÄæ¡A·Q½Ð°Ý¸Ó¦p¦óקï¤~¯àÅý¸ê®Æª½±µ±q²Ä¤G¦C¶}©l¨Ì§Ç©¹¤U·s¼W¡AÁÂÁÂ!
Book.zip (22 Bytes)
|
-
-
Book.zip
(22 Bytes)
|
|
|
|
|
|
- ©«¤l
- 835
- ¥DÃD
- 6
- ºëµØ
- 0
- ¿n¤À
- 915
- ÂI¦W
- 16
- §@·~¨t²Î
- Win 10,7
- ³nÅ骩¥»
- 2019,2013,2003
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2010-5-3
- ³Ì«áµn¿ý
- 2024-11-14
|
¦^´_ 1# Sofie
À£ÁYÀɤj¤p¥u¦³ 22 ÓBytes -----> ExcelÀɨS¥[¶i¨Ó, ½Ð«À£«á¦A«¶Ç¤W¨Ó. |
|
|
|
|
|
|
- ©«¤l
- 4
- ¥DÃD
- 1
- ºëµØ
- 0
- ¿n¤À
- 5
- ÂI¦W
- 0
- §@·~¨t²Î
- Office
- ³nÅ骩¥»
- 2010
- ¾\ŪÅv
- 10
- µù¥U®É¶¡
- 2016-4-10
- ³Ì«áµn¿ý
- 2016-7-11
|
|
|
|
|
|
|
- ©«¤l
- 471
- ¥DÃD
- 121
- ºëµØ
- 0
- ¿n¤À
- 579
- ÂI¦W
- 0
- §@·~¨t²Î
- WIN10
- ³nÅ骩¥»
- OFFICE2019
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2015-4-16
- ³Ì«áµn¿ý
- 2023-1-17
|
¦^´_ 3# Sofie
Private Sub CommandButton1_Click()
n = Cells(ActiveSheet.Rows.Count, 2).End(xlUp).Row + 1 '©¹³Ì«á¦³¸ê®Æ¦C+1¶K¤W
If Range("b" & n) = "" Then
Sheets("Sheet1").Range("b" & n).Value = TextBox1.Value
End If
If Range("c" & n) = "" Then
Sheets("Sheet1").Range("c" & n).Value = TextBox2.Value
End If
End Sub |
|
|
|
|
|
|
- ©«¤l
- 4
- ¥DÃD
- 1
- ºëµØ
- 0
- ¿n¤À
- 5
- ÂI¦W
- 0
- §@·~¨t²Î
- Office
- ³nÅ骩¥»
- 2010
- ¾\ŪÅv
- 10
- µù¥U®É¶¡
- 2016-4-10
- ³Ì«áµn¿ý
- 2016-7-11
|
¦^´_ 4# starry1314
·PÁ¦^ÂÐ!
«á¨Ó§ÚÄ~Äò©µ¦ù°ÝÃD¡A·Q«ö¦~Ä֯ŶZ©ó¤£¦P°_©l¦C·s¼W¸ê®Æ¡A¤ñ¦p»¡¦~ÄÖ¤j©ó60·³ªº±q²Ä20¦C¶}©l·s¼W¡A
¨BÆJ1. key ±iXX 12
¨BÆJ2. key ªLOO 65
¨BÆJ3. keyªLOO 24
¦ý¬O·í¦~ÄÖ¤j©ó60ªº¸ê®Æ¶i¨Ó¤§«á¡A²Ä¤Tµ§¤p©ó60·³ªº¸ê®Æ´N·|¸òµÛ¨BÆJ3ªºµ²ªG©¹¤U·s¼W¡A¦Ó¤£¬O±q¨BÆJ1ªºµ²ªG©¹¤U¡A
·Q½Ð°Ý§Ú¤Ö§PÂ_¤F¤°»ò¦a¤è¡AÁÂÁÂ~
- Private Sub CommandButton1_Click()
- n = Cells(ActiveSheet.Rows.Count, 2).End(xlUp).Row + 1 '©¹³Ì«á¦³¸ê®Æ¦C+1¶K¤W
-
- If Range("b" & n) = "" And TextBox2.Value > 60 Then
-
-
- Sheets("Sheet1").Range("b" & 20 + n).Value = TextBox1.Value
-
-
- Sheets("Sheet1").Range("c" & 20 + n).Value = TextBox2.Value
-
- Else
-
- Sheets("Sheet1").Range("b" & n).Value = TextBox1.Value
-
-
- Sheets("Sheet1").Range("c" & n).Value = TextBox2.Value
-
- End If
-
- End Sub
½Æ»s¥N½X |
|
|
|
|
|
|
- ©«¤l
- 471
- ¥DÃD
- 121
- ºëµØ
- 0
- ¿n¤À
- 579
- ÂI¦W
- 0
- §@·~¨t²Î
- WIN10
- ³nÅ骩¥»
- OFFICE2019
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2015-4-16
- ³Ì«áµn¿ý
- 2023-1-17
|
¦^´_ 5# Sofie
If Range("B" & n) = "" And TextBox2.Value > 60 Then
If Range("C" & n) = "" And TextBox2.Value > 60 Then
§PÂ_¦~ÄÖªº¦a¤è¿ù¤F....
±q20¦C¶}©l·s¼W..¨S·Q¨ì«ç»ò°µ
¦]¬°¥Ø«e¬O¥H²Ä20¦C+³Ì«á¤@¦CªºÁ`¦C¼Æ ©Ò¥H¤¤¶¡·|¤@ª½ªÅ«Ü¤j®æ |
|
|
|
|
|
|
- ©«¤l
- 60
- ¥DÃD
- 4
- ºëµØ
- 0
- ¿n¤À
- 64
- ÂI¦W
- 0
- §@·~¨t²Î
- w7-32
- ³nÅ骩¥»
- 2013.2003
- ¾\ŪÅv
- 20
- µù¥U®É¶¡
- 2014-11-23
- ³Ì«áµn¿ý
- 2016-6-6
|
x = TextBox2.Value
If x < 60 Then
y = [B20].End(xlUp).Row + 1
Else
y = [B65536].End(xlUp).Row + 1
If y < 20 Then y = 20
End If
Cells(y, 2) = x |
|
|
|
|
|
|
- ©«¤l
- 2025
- ¥DÃD
- 13
- ºëµØ
- 0
- ¿n¤À
- 2053
- ÂI¦W
- 0
- §@·~¨t²Î
- WIN7
- ³nÅ骩¥»
- Office2007
- ¾\ŪÅv
- 100
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¥_¥«
- µù¥U®É¶¡
- 2011-3-2
- ³Ì«áµn¿ý
- 2024-3-14
|
- Option Explicit
- Public n As Integer
- Private Sub CommandButton1_Click()
- If TextBox2.Value > 60 Then n = 20 Else n = 2
- Do
- If Cells(n, "B") = "" Then Exit Do
- n = n + 1
- Loop
- Sheets("Sheet1").Cells(n, "B").Value = TextBox1.Value
- Sheets("Sheet1").Cells(n, "C").Value = TextBox2.Value
- End Sub
½Æ»s¥N½X |
|
{...} ªí¥Ü»Ýn¥Î CTRL+SHIFT+ENTER ¤TÁä¿é¤J¤½¦¡
|
|
|
|
|
- ©«¤l
- 4
- ¥DÃD
- 1
- ºëµØ
- 0
- ¿n¤À
- 5
- ÂI¦W
- 0
- §@·~¨t²Î
- Office
- ³nÅ骩¥»
- 2010
- ¾\ŪÅv
- 10
- µù¥U®É¶¡
- 2016-4-10
- ³Ì«áµn¿ý
- 2016-7-11
|
¦^´_ 6# starry1314
¦^´_ 7# koo
¦^´_ 8# ML089
·PÁ¦U¦ì«e½úªº¤À¨É¡A¥Ø«e¨Ï¥Îkoo¤jªº¤èªk¥i¦æ! |
|
|
|
|
|
|