|
楼主 |
发表于 2012-9-2 16:40
|
显示全部楼层
柳如烟 发表于 2012-9-2 16:01
Private Sub CommandButton1_Click()
Dim arr, i%, d As Object
Set d = CreateObject("scripting.dictionary")
arr = Sheets("客户资料").Range("a1:c" & Sheets("客户资料").Range("a65536").End(3).Row)
For i = 2 To UBound(arr)
d.Add arr(i, 1) & arr(i, 2), i
Next
For i = 1 To 12
If Me.Controls("OptionButton" & i).Value = True Then
Cells(d(TextBox1.Value & TextBox2.Value), i + 4) = TextBox3.Value
Exit For
End If
Next
TextBox1.Value = TextBox1.Value + 1
TextBox3 = ""
TextBox3.SetFocus
Set d = Nothing
End Sub
Private Sub TextBox1_Change()
Dim arr, i%
arr = Sheets("客户资料").Range("a2:b" & Sheets("客户资料").Range("a65536").End(3).Row)
For i = 1 To UBound(arr)
If TextBox1.Value * 1 = arr(i, 1) Then
TextBox2.Value = arr(i, 2)
End If
Next
End Sub
那要把你的这段代码放到上面的代码中呢,谢谢
|
|