你可以试试这个方法。
代码是
Private Sub ComboBox3_Change()
With Worksheets("Sheet3")
.AutoFilterMode = False
.Range("B:D").AutoFilter Field:=1, Criteria1:=ComboBox1.Value, Operator:=xlAnd
.Range("B:D").AutoFilter Field:=2, Criteria1:=ComboBox2.Value, Operator:=xlAnd
.Range("B:D").AutoFilter Field:=3, Criteria1:=ComboBox3.Value, Operator:=xlAnd
End With
With Worksheets("Sheet3")
If rowNumber = 1 Then
MsgBox "No Record with those details."
Else
rowNumber = .Range("F65536").End(xlUp).Row
Worksheets("Sheet3").Range("F" & rowNumber & ":H" & rowNumber).Copy
Worksheets("Sheet2").Range("A2").PasteSpecial
End If
End With
结束子
希望这会帮助你。