sub bijiao() dim a() dim i as long dim b '定义数组 redim a(0 to 10) '数组赋值 for i=0 to ubound(a) a(i)=i next 'b赋值 b=6 '循环比较 for i=0 to ubound(a) if b=a(i) then exit for next '判断是否找到 if i>ubound(a) then msgbox "没有找到" else redim preserve a(0 to ubound(a)+1) a(ubound(a))=b end if end sub追问