sub m()
for i= 23 to range("A65536").end(3).row
if cells(i,"D")="" or cells(i,"G")="" then
exit for
else
Sheets(2).cells(i-19,"A")=cells(i,"A")
Sheets(2).cells(i-19,"B")=cells(i,"B")
Sheets(2).cells(i-19,"C")=cells(i,"C")
Sheets(2).cells(i-19,"E")=cells(i,"E")
Sheets(2).cells(i-19,"F")=cells(i,"F")
end if
next
end sub
将代码放到sheet1中,执行即可