漏了以下红色字:
Private Sub ListBox2_Click()
Dim cell As Range
ListBox1.Clear
Set x = Sheets("明细").Range("a2:a" & Sheets("明细").[a65536].End(xlUp).Row)
With ListBox1
.ColumnCount = 5
.ColumnWidths = "45,80,45,30,30"
.ListStyle = 1
.MultiSelect = 1
.BoundColumn = 1
End With
For Each cell In x
If cell.Value = ListBox2.Text Then
'MsgBox cell.Value
'cell.Select
ListBox1.AddItem
For i = 0 To 4
ListBox1.List(ListBox1.ListCount - 1, i) = cell.Offset(, i).Value
Next
End If
Next cell
End Sub