第1个回答 2016-05-27
sub test()
with activesheet
dim a,b,c
for i = 1 to 1000'如果要查询的行数超过1000请自己改
a=.rows(i).find("金银花",lookat:=xlwhole)
b=activesheet.rows(i).find("菊花",lookat:=xlwhole)
if a <> "" and b <> "" then
c=c+1
elseif .cells(i,1)="" then'每行数据之间不能有空行
exit for
end if
next
msgbox "找到了" & c & "组"
end sub