用高級(jí)篩選,條件直接輸單元格或數(shù)組賦值單元格
例舉參考
Private Sub CommandButton1_Click()
Sheet1.Activate
[x1:x4] = Application.Transpose(Array("日期", "2014/1/1", "2014/1/2", "2014/1/3"))
If Cells.Rows.Count = Cells.SpecialCells(12).Rows.Count Then
Range("$A$1:$E$" & Cells(Rows.Count, 1).End(3).Row).AdvancedFilter 1, [x1:x4]
Else
ActiveSheet.ShowAllData
End If
End Sub |
|