设你拟查询的数据在数组arr中,使用for...to:
下面的语句是基于VBA写的,即在EXCEL中自带的VBA写:
sub a()
dim arr(1 to 300)
dim i%,l%
i=range("A63655").end(xlup).row '计算查找字段中的行数
for l=1 to 300
if application.WorksheetFunction.countif(range(cells(1,1) _
,cells(i,1),arr(l))>0 then msgbox arr(l) & "数据已存在"
next l
end sub