|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
双击出库单的空白行提示编译错误找不到工程或库呢?
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)------这个地方变黄体
On Error Resume Next '忽略错误值
If Target.Column = 3 Then
If Target.Row < 18 And Target.Row > 5 Then
If Me.ListBox1.Visible = True Then
Me.ListBox1.Visible = False
Else
'清空原来数据,重新赋值
Me.ListBox1.Clear
With Sheet1
For x = 2 To .Range("A65300").End(3).Row
Me.ListBox1.AddItem
Me.ListBox1.List(x - 2, 0) = .Cells(x, "A") '
Me.ListBox1.List(x - 2, 1) = .Cells(x, "B") '
Me.ListBox1.List(x - 2, 2) = .Cells(x, "C")
Me.ListBox1.List(x - 2, 3) = .Cells(x, "E")
Me.ListBox1.List(x - 2, 4) = .Cells(x, "F")
ListBox1.ColumnWidths = 50 & ";" & 100 & ";" & 200
yscmhs = .Range("A65300").End(3).Row - 2
Next
End With
Me.ListBox1.Visible = True
End If
If Me.TextBox1.Visible = True Then
Me.TextBox1.Visible = False
Else
Me.TextBox1.Visible = True
Me.TextBox1 = Cells(Selection.Row, 3)
Me.TextBox1.Activate
End If
End If
End If
End Sub |
|