¤U©Ô¦¡n¦p¦ó¿ï¾Ü«á·|¦Û°Ê±a¥X¨ä¥Lªí³æ°T®§
- ©«¤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 ©ó 2013-3-7 14:56 ½s¿è
¦^´_ 3# Jared
¸Õ¸Õ¬Ý³o¬O§_¦p§A©Ò»Ý- 'ListIndex = -1: ©Ò¿ïªº¤£¦b List²M³æ¤º
- Private Sub ComboBox1_Change()
- If ComboBox1.ListIndex > -1 Then
- À\ÂI
- Else
- ComboBox2 = ""
- End If
- End Sub
- Private Sub ComboBox2_Change()
- TextBox1 = ""
- If ComboBox2.ListIndex > -1 Then TextBox1 = ComboBox2.List(ComboBox2.ListIndex, 1)
- End Sub
- Private Sub CommandButton1_Click()
- Dim A
- If ComboBox1.ListIndex = -1 Or ComboBox2.ListIndex = -1 Then MsgBox "À\ÂI¤º®e »Ý»ô¥þ !!": Exit Sub
- With Sheet10
- .Cells(.Rows.Count, 1).End(xlUp).Offset(1).Resize(, 3).Value = Array(ComboBox1, ComboBox2, TextBox1)
- End With
- End Sub
- Private Sub CommandButton2_Click()
- test4.Hide
- End Sub
- Private Sub CommandButton3_Click()
- Me.ComboBox1 = ""
- Me.ComboBox2 = ""
- Me.TextBox1 = ""
- End Sub
- Private Sub UserForm_Initialize()
- ComboBox1.List = Array("¤@¸¹À\", "¤G¸¹À\", "¤T¸¹À\")
- End Sub
- Private Sub À\ÂI()
- With ComboBox2
- .Clear
- Select Case ComboBox1.ListIndex
- Case 0 '¤@¸¹À\
- .AddItem "º~³ù¡BÁ¦±ø¡B¥i¼Ö"
- .List(.ListCount - 1, 1) = 50 'ComboBox2ªº²Ä2Äæ ¨SÅã¥Ü¥X¨Ó
- .AddItem "º~³ù¡BÁ¦»æ¡B¥i¼Ö"
- .List(.ListCount - 1, 1) = 49
- .AddItem "º~³ù¡BÁ¦»æ¡B¬õ¯ù"
- .List(.ListCount - 1, 1) = 48
- Case 1 '¤G¸¹À\
- .AddItem "Âû¶ô¡BÁ¦±ø¡B¥i¼Ö"
- .List(.ListCount - 1, 1) = 47 'ComboBox2ªº²Ä2Äæ ¨SÅã¥Ü¥X¨Ó
- .AddItem "Âû¶ô¡BÁ¦»æ¡B¥i¼Ö"
- .List(.ListCount - 1, 1) = 46
- .AddItem "Âû¶ô¡BÁ¦»æ¡B¬õ¯ù"
- .List(.ListCount - 1, 1) = 45
- Case 2 '¤T¸¹À\
- .AddItem "«p¤g¥q¡BÁ¦±ø¡B¥i¼Ö"
- .List(.ListCount - 1, 1) = 44 'ComboBox2ªº²Ä2Äæ ¨SÅã¥Ü¥X¨Ó
- .AddItem "«p¤g¥q¡BÁ¦»æ¡B¥i¼Ö"
- .List(.ListCount - 1, 1) = 43
- .AddItem "«p¤g¥q¡BÁ¦»æ¡B¬õ¯ù"
- .List(.ListCount - 1, 1) = 42
- End Select
- End With
- TextBox1 = ""
- End Sub
½Æ»s¥N½X |
|
|
|
|
|
|
- ©«¤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 ©ó 2013-3-7 18:22 ½s¿è
¦^´_ 5# Jared
ªþÀɸոլÝ
test.rar (25.17 KB)
- 'ListIndex = -1: ©Ò¿ïªº¤£¦b List²M³æ¤º
- Private Sub ComboBox1_Change()
- If ComboBox1.ListIndex > -1 Then
- À\ÂI
- Else
- ListBox1.RowSource = ""
- End If
- End Sub
- Private Sub CommandButton1_Click()
- Dim A
- If ComboBox1.ListIndex = -1 Or Me.ListBox1.ListIndex = -1 Then MsgBox "À\ÂI¤º®e »Ý»ô¥þ !!": Exit Sub
- With Sheet10
- .Cells(.Rows.Count, 1).End(xlUp).Offset(1).Resize(, 3).Value = Array(ComboBox1, ListBox1.List(ListBox1.ListIndex, 0), ListBox1.List(ListBox1.ListIndex, 1))
- End With
- End Sub
- Private Sub CommandButton2_Click()
- test4.Hide
- End Sub
- Private Sub CommandButton3_Click()
- ComboBox1 = ""
- End Sub
- Private Sub UserForm_Initialize()
- With ListBox1
- .ColumnWidths = .Width * (2 / 3) & "," & .Width * (1 / 3) 'Åã¥ÜÄæ¼e«×
- .ColumnHeads = True 'Äæ¦ìÅã¥Ü ªíÀY
- .TextAlign = fmTextAlignCenter '¤å¦r¸m¤¤
- .ColumnCount = 2 'Åã¥ÜÄæ¦ì¼Æ À\ÂI¤º®e,»ù¿ú ¨âÄæ
- .Font.Size = 12
- End With
- With ComboBox1
- .Font.Size = 12
- .TextAlign = fmTextAlignCenter '¤å¦r¸m¤¤
- End With
- ®MÀ\©w¸q
- End Sub
- Private Sub À\ÂI()
- With ListBox1
- .RowSource = "" '²M°£ListBox ²M³æªº¨Ó·½
- .RowSource = Sheets("®MÀ\").Names(ComboBox1.Value).RefersTo '«ü©wListBox ²M³æªº¨Ó·½ A1:C5 ½d³òªº§Î¦¡(¤£¬O R1C1)
- End With
- End Sub
- Private Sub ®MÀ\©w¸q() '©w¸q¦WºÙ
- Dim R As Variant, i As Integer
- With Sheets("®MÀ\")
- For Each R In .Names
- R.Delete '²M°£®MÀ\ªº©w¸q¦WºÙ
- Next
- Set R = .[A1]
- i = 1
- Do While .Cells(i, "A") <> ""
- Set R = R.End(xlToRight)
- ComboBox1.AddItem .Cells(i, "A")
- .Names.Add Name:=.Cells(i, "A"), RefersTo:=.Range(R.CurrentRegion.Rows(2), R.CurrentRegion.Rows(R.CurrentRegion.Rows.Count))
- '.Names.Add ·s¼W ®MÀ\ªº©w¸q¦WºÙ
- i = i + 1
- Set R = R.End(xlToRight)
- Loop
- End With
- End Sub
½Æ»s¥N½X |
|
|
|
|
|
|
- ©«¤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
        
|
¦^´_ 8# Jared
²Ä¤@ºØ¼gªk¥Ø«e´N¬O¿ï¾Ü§¹²Ä¤@ÓComboBox1
²Ä¤Gӿﶵ·|¥ý©IÀ³ªÅ¥Õ
¥u¬O·QnÅý¥L´£«e¥ýÅã¥Ü¥X¨Ó²Ä¤@¶µ
¬O³o¼Ë¶Ü? 1#ªí³æªºµ{¦¡½X- 'ListIndex = -1: ©Ò¿ïªº¤£¦b List²M³æ¤º
- Dim »ù®æ
- Private Sub ComboBox1_Change()
- ComboBox2 = ""
- TextBox1 = ""
- If ComboBox1.ListIndex > -1 Then
- ComboBox2 = ComboBox2.List(ComboBox1.ListIndex)
- TextBox1 = »ù®æ(ComboBox1.ListIndex)
- End If
- End Sub
- ' Private Sub ComboBox2_Change()
- ' TextBox1 = ""
- ' If ComboBox2.ListIndex > -1 Then TextBox1 = »ù®æ(ComboBox1.ListIndex)
- ' End Sub
- '****************************************************
- Private Sub CommandButton1_Click()
- If ComboBox1.ListIndex = -1 Then MsgBox "À\ÂI¤º®e »Ý»ô¥þ !!": Exit Sub
- With Sheet10
- .Cells(.Rows.Count, 1).End(xlUp).Offset(1).Resize(, 3).Value = Array(ComboBox1, ComboBox2, TextBox1)
- End With
- End Sub
- Private Sub CommandButton2_Click()
- test4.Hide
- End Sub
- Private Sub CommandButton3_Click()
- ComboBox1 = ""
- End Sub
- Private Sub UserForm_Initialize()
- With ComboBox1
- .Font.Size = 12
- .TextAlign = fmTextAlignCenter '¤å¦r¸m¤¤
- .List = Array("¤@¸¹À\", "¤G¸¹À\", "¤T¸¹À\")
- End With
- With ComboBox2
- .Font.Size = 12
- .TextAlign = fmTextAlignCenter '¤å¦r¸m¤¤
- .List = Array("º~³ù¡BÁ¦±ø¡B¥i¼Ö", "Âû¶ô¡BÁ¦»æ¡B¬õ¯ù", "Á¦»æ¡BÁ¦±ø¡B¦B²N²O")
- .Locked = True '¸T¤î½s¿è
- End With
- With TextBox1
- .Locked = True '¸T¤î½s¿è
- .Font.Size = 12
- .TextAlign = fmTextAlignCenter '¤å¦r¸m¤¤
- End With
- »ù®æ = Array(50, 60, 70)
- End Sub
½Æ»s¥N½X |
|
|
|
|
|
|