Private Sub TextBox1_Change()
ListBox1.Clear
ListBox2.Clear
End Sub
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Verb = TextBox1.Text
n = Worksheets("sheet2").Columns("C:C").Find(Verb, SearchDirection:=xlPrevious, lookat:=xlWhole).Row
a = Split(Worksheets("sheet2").Range("g" & n).Value, ",")
b = Split(Worksheets("sheet2").Range("e" & n).Value, ",")
'-----------------------JC取值代码----------------------------'
j = UBound(a)
For i = 0 To j
ListBox1.AddItem (i)
ListBox1.List(i) = a(i)
ListBox2.AddItem (i)
ListBox2.List(i) = b(i)
TextBox3.Text = j & "**" & a(i) & "**" & b(i)
Next
End Sub
Private Sub CommandButton1_Click()
For i = 0 To ListBox1.ListCount
If ListBox1.Selected(i) Then
JC = ListBox1.Text
End If
Next
For i = 0 To ListBox2.ListCount
If ListBox2.Selected(i) Then
VVT = Split(ListBox2.Text, "/")
End If
Next
If UBound(VVT) = 0 Then
l = Worksheets("sheet3").Columns("G:H").Find(ListBox2.Text, SearchDirection:=xlPrevious, lookat:=xlWhole).Row
Noun = Worksheets("sheet3").Range("d" & l).Value
ElseIf UBound(VVT) > 0 Then
For i = 0 To UBound(VVT)
l = Worksheets("sheet3").Columns("G:H").Find(VVT(i), SearchDirection:=xlPrevious, lookat:=xlWhole).Row
Noun = Worksheets("sheet3").Range("d" & l).Value
TextBox2.Text = TextBox2.Text + "/" & VVT(i) & "/" & Verb + Noun
Next
End If
End Sub
ListBox1.Clear
ListBox2.Clear
End Sub
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Verb = TextBox1.Text
n = Worksheets("sheet2").Columns("C:C").Find(Verb, SearchDirection:=xlPrevious, lookat:=xlWhole).Row
a = Split(Worksheets("sheet2").Range("g" & n).Value, ",")
b = Split(Worksheets("sheet2").Range("e" & n).Value, ",")
'-----------------------JC取值代码----------------------------'
j = UBound(a)
For i = 0 To j
ListBox1.AddItem (i)
ListBox1.List(i) = a(i)
ListBox2.AddItem (i)
ListBox2.List(i) = b(i)
TextBox3.Text = j & "**" & a(i) & "**" & b(i)
Next
End Sub
Private Sub CommandButton1_Click()
For i = 0 To ListBox1.ListCount
If ListBox1.Selected(i) Then
JC = ListBox1.Text
End If
Next
For i = 0 To ListBox2.ListCount
If ListBox2.Selected(i) Then
VVT = Split(ListBox2.Text, "/")
End If
Next
If UBound(VVT) = 0 Then
l = Worksheets("sheet3").Columns("G:H").Find(ListBox2.Text, SearchDirection:=xlPrevious, lookat:=xlWhole).Row
Noun = Worksheets("sheet3").Range("d" & l).Value
ElseIf UBound(VVT) > 0 Then
For i = 0 To UBound(VVT)
l = Worksheets("sheet3").Columns("G:H").Find(VVT(i), SearchDirection:=xlPrevious, lookat:=xlWhole).Row
Noun = Worksheets("sheet3").Range("d" & l).Value
TextBox2.Text = TextBox2.Text + "/" & VVT(i) & "/" & Verb + Noun
Next
End If
End Sub
