|
本帖最后由 excelneko 于 2015-1-21 12:10 编辑
请问这是什么问题
某次进入库存物资明细账后
输入要查询的物资型号就弹出1004错误窗口
按调试就出现下面一堆代码
现在库存物资明细账这个功能完全用不了了
每次都是弹出1004窗口
求解决办法
Public Myr&, Arrsj
Private Sub Worksheet_Activate()
Application.ScreenUpdating = False
With Sheets("数据库")
.Unprotect 123
.Range("A2:S" & .Range("A65536").End(3).Row).Sort Key1:=.Range("C2"), Order1:=xlAscending
.Protect 123
End With
If Range("M65500").End(3).Row > 600 Then '删除多余格式行
ActiveSheet.Unprotect
Rows("550:600").Delete
ActiveSheet.Protect 123
End If
MX
Application.ScreenUpdating = True
End Sub
Private Sub ListBOX1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
ActiveCell = Me.ListBox1.List(Me.ListBox1.ListIndex, 0)
Me.ListBox1.Clear
Me.TextBox1 = ""
Me.ListBox1.Visible = False
Me.TextBox1.Visible = False
End Sub
Private Sub TextBOX1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
Dim t%
On Error Resume Next
With TextBox1
Select Case KeyCode
Case 13 '回车
.TopLeftCell = TextBox1.Value
KeyCode = 0
Case 40 '向下
ListBox1.Activate
Case 27 'Esc
TextBox1.Visible = False
ListBox1.Visible = False
Selection.Select
End Select
End With
End Sub
|
|