sub xx() set wks1=sheets("表1") set wks2=sheets("表2") dim ar1,ar2() ar1=application.index(wks1.usedrange,2,0) dim rowh() 'ar1与ar2()均为一维数组. for i=0 to wks2.usedrange.rows.count-1 ar2(i)=application.index(wks2.usedrange,i+1,0) if ar1(1)&ar1(2) =ar2(i)(1)&ar2(i)(2) and ar2(i)(3)>ar1(3) and ar2(i)(4)<ar1(4) then redim preserve rowh(j+1) rowh(j)=i+1 j=j+1 end if next for x=0 to ubound(rowh) wks2.rows(rowh(x)).interior.colorindex=8 next