Excel 请问怎么用VBA实现多组合条件查询

如题所述

也许不用VBA,直接使用透视表更方便。看你的具体情况是怎样的要求。
温馨提示:答案为网友推荐,仅供参考
第1个回答  推荐于2017-10-03
可以用if语句和select case 语句
if 条件 then
语句;
elseif 条件 then
语句;
else
语句;
end if
其中语句里面可以在嵌套if语句如:
if 条件 then
if 条件 then

语句;
end if
elseif 条件 then
语句;
else
语句;
end if

也可以使用select case 语句
select case 变量
case 变量的值1
语句;
case 变量的值2
语句;
case 变量的值3
语句;
end select

if和select case区别就是,if可以支持精确和模糊查找,select case 只能支持精确查找本回答被提问者采纳
相似回答