能!
分两种情况,
1、mshflexgrid显示的数据库信息,直接通过数据库SQL条件查询,然后再mshflexgrid中显示结果;
2、通过循环判断!
'假设判断第一列字符中含有“中”字,则在第2列中显示为“yes”否则显示“no”
dim s1 as String,k as Integer
with mshflexgrid1
if .rows<2 then exit sub
k=0
for i = 1 to .rows-1
s1=trim(.TextMatrix(i, 1) )
if instr(1,s1,"中")>0 then
.TextMatrix(i, 2)=“yes”
k=k+1
else
.TextMatrix(i, 2)=“no”
endif
next
MsgBox " 共" & k & " 个符合条件!"
end with
追问这个标记我看懂了,我想问下,能否自动滚动到满足条件的那一行?