您可以使用自動過濾器在日期列中對其進行過濾,然後將這些記錄複製到目標工作表。
也許是這樣的:
Dim xSheet1 As Worksheet
Dim xSheet2 As Worksheet
Dim iLastRow As Integer
Set xSheet1 = Sheets("sheet1")
Set xSheet2 = Sheets("Sheet2")
iLastRow = xSheet1.Range("A" & xSheet1.Rows.Count).End(xlUp).Row
xSheet2.Cells.Clear
Range("F1").Value = "check"
Range("F2:F" & iLastRow).Formula = "=IF(AND(B:B=""Nike"",TEXT(D:D,""DD/MM/YYYY"")=""23/05/2013""),1,0)"
Range("F1").AutoFilter Field:=1, Criteria1:="1"
Range("A2:D" & iLastRow).Copy
xSheet2.Range("A2").PasteSpecial Paste:=xlPasteAll, SkipBlanks:=True
With xSheet1
.Range("F1").AutoFilter
.Range("F1:F" & Range("A1").End(xlDown).Row).Clear
End With
的[搜索正確的數據,在Excel VBA中打印](
可能重複http://stackoverflow.com/questions/17311809/search-the-correct-data-和-print-in-excel-vba) –
你問了幾乎相同的問題。兩者之間沒有重要區別,所以,我會建議關閉一個... –
已經發布。我想問的是這個問題。對不起,讓你感到困惑。 – user1928481