|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
表示在64位win8+32位Excel2013除分项查询外有点问题,其他功能基本可以顺利运行,但是我改动单据录入页listbox1的列宽后就报运行13类型不匹配,- Private Sub TextBOX1_KeyUp(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
- Dim I&, J%, t%, myStr$, k&, N$, P$, S$
- Dim LG As Boolean, Arr1()
- Me.ListBox1.Clear
- myStr = UCase(Me.TextBox1.Value)
- For I = 1 To Len(myStr)
- If Asc(Mid$(myStr, I, 1)) < 0 Then LG = True: Exit For
- Next
- arr2 = Array("编 码", "物 品 名 称", "规格型号", "单位")
- k = k + 1
- ReDim Arr1(1 To 4, 1 To k)
- For I = 1 To 4
- Arr1(I, k) = arr2(I - 1)
- Next
- For I = 1 To UBound(Arrsj) ’错误代码 arrsj为空值
- S = Arrsj(I, 1) & " " & Arrsj(I, 2) & " " & Arrsj(I, 3)
- N = ""
- If LG Then
- N = S
- Else
- N = PINYIN(S)
- End If
- If InStr(N, myStr) Then
- k = k + 1
- ReDim Preserve Arr1(1 To 4, 1 To k)
- For t = 1 To 4
- Arr1(t, k) = Arrsj(I, t)
- Next
- End If
- Next I
- If t = 0 Then Exit Sub
- Me.ListBox1.List = Application.Transpose(Arr1)
- End Sub
复制代码
请老师指导! |
|