|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
请教:判断在ven(ComboBox控件)中所输入的值是否在表格中存在,如果不存在,弹出提示窗口,提示“所输入的信息不存在”
Private Sub ven_Change()
Dim r1 As Range, Arr
If Me.ven.Text = "" Then Exit Sub
With Sheets("业务资料")
Set r1 = .Columns(2).Find(ven.Text, , , 1)
Arr = .Range(.Cells(r1.Row, 2), .Cells(r1.Row, 17))
End With
With Me
.ven.Text = Arr(1, 1)
.em = Arr(1, 2)
.ad2 = Arr(1, 3)
.tel = Arr(1, 4)
.fax = Arr(1, 5)
.rel = Arr(1, 6)
.post = Arr(1, 7)
.ban = Arr(1, 8)
.acc = Arr(1, 9)
.dut = Arr(1, 10)
.ad1 = Arr(1, 11)
.tel2 = Arr(1, 12)
.mob = Arr(1, 13)
.yue = Arr(1, 14)
.jifen = Arr(1, 15)
.zhuce = Arr(1, 16)
End With
End Sub
|
|