ExcelHome技术论坛

 找回密码
 免费注册

QQ登录

只需一步,快速开始

快捷登录

搜索
EH技术汇-专业的职场技能充电站 妙哉!函数段子手趣味讲函数 Excel服务器-会Excel,做管理系统 效率神器,一键搞定繁琐工作
HR薪酬管理数字化实战 Excel 2021函数公式学习大典 Excel数据透视表实战秘技 打造核心竞争力的职场宝典
让更多数据处理,一键完成 数据工作者的案头书 免费直播课集锦 ExcelHome出品 - VBA代码宝免费下载
用ChatGPT与VBA一键搞定Excel WPS表格从入门到精通 Excel VBA经典代码实践指南
查看: 2056|回复: 8

[求助] 高手帮我解决一下多工作表按条件汇总

[复制链接]

TA的精华主题

TA的得分主题

发表于 2010-2-27 10:25 | 显示全部楼层 |阅读模式
这是一个仓库库位管理表格,很实用的,哪位高手帮我解决最后一步,在公式区求不到很好的解决方法,看看这里怎么样

求助.rar

65 KB, 下载次数: 83

TA的精华主题

TA的得分主题

发表于 2010-2-27 11:49 | 显示全部楼层
第一、二行的所在的字段都是合并单元格,表格格式不改的话,不能用透视表

TA的精华主题

TA的得分主题

发表于 2010-2-27 13:36 | 显示全部楼层
吼吼,你又来这里发帖,我的03版只能接受12个货架的:
SELECT 编号, 名称, MAX(区域) AS 区域1, IIF(MAX(区域)=MIN(区域),'',MIN(区域)) AS 区域2
FROM (select * from [01$B3:D27] UNION select * from [01$E3:G27] UNION select * from [01$H3:J27] UNION select * from [01$K3:M27] UNION        select * from [02$B3:D27] UNION select * from [02$E3:G27] UNION select * from [02$H3:J27] UNION select * from [02$K3:M27] UNION        select * from [03$B3:D27] UNION select * from [03$E3:G27] UNION select * from [03$H3:J27] UNION select * from [03$K3:M27] UNION        select * from [04$B3:D27] UNION select * from [04$E3:G27] UNION select * from [04$H3:J27] UNION select * from [04$K3:M27] UNION        select * from [05$B3:D27] UNION select * from [05$E3:G27] UNION select * from [05$H3:J27] UNION select * from [05$K3:M27] UNION        select * from [06$B3:D27] UNION select * from [06$E3:G27] UNION select * from [06$H3:J27] UNION select * from [06$K3:M27] UNION        select * from [07$B3:D27] UNION select * from [07$E3:G27] UNION select * from [07$H3:J27] UNION select * from [07$K3:M27] UNION        select * from [08$B3:D27] UNION select * from [08$E3:G27] UNION select * from [08$H3:J27] UNION select * from [08$K3:M27] UNION        select * from [09$B3:D27] UNION select * from [09$E3:G27] UNION select * from [09$H3:J27] UNION select * from [09$K3:M27] UNION        select * from [10$B3:D27] UNION select * from [10$E3:G27] UNION select * from [10$H3:J27] UNION select * from [10$K3:M27] UNION        select * from [11$B3:D27] UNION select * from [11$E3:G27] UNION select * from [11$H3:J27] UNION select * from [11$K3:M27] UNION        select * from [12$B3:D27] UNION select * from [12$E3:G27] UNION select * from [12$H3:J27] UNION select * from [12$K3:M27])
WHERE (编号 Is Not Null)
GROUP BY 编号, 名称
ORDER BY 编号


那位用07版或10版的,测试以下代码:

SELECT 编号, 名称, MAX(区域) AS 区域1, IIF(MAX(区域)=MIN(区域),'',MIN(区域)) AS 区域2
FROM (select * from [01$B3:D27] UNION select * from [01$E3:G27] UNION select * from [01$H3:J27] UNION select * from [01$K3:M27] UNION        select * from [02$B3:D27] UNION select * from [02$E3:G27] UNION select * from [02$H3:J27] UNION select * from [02$K3:M27] UNION        select * from [03$B3:D27] UNION select * from [03$E3:G27] UNION select * from [03$H3:J27] UNION select * from [03$K3:M27] UNION        select * from [04$B3:D27] UNION select * from [04$E3:G27] UNION select * from [04$H3:J27] UNION select * from [04$K3:M27] UNION        select * from [05$B3:D27] UNION select * from [05$E3:G27] UNION select * from [05$H3:J27] UNION select * from [05$K3:M27] UNION        select * from [06$B3:D27] UNION select * from [06$E3:G27] UNION select * from [06$H3:J27] UNION select * from [06$K3:M27] UNION        select * from [07$B3:D27] UNION select * from [07$E3:G27] UNION select * from [07$H3:J27] UNION select * from [07$K3:M27] UNION        select * from [08$B3:D27] UNION select * from [08$E3:G27] UNION select * from [08$H3:J27] UNION select * from [08$K3:M27] UNION        select * from [09$B3:D27] UNION select * from [09$E3:G27] UNION select * from [09$H3:J27] UNION select * from [09$K3:M27] UNION        select * from [10$B3:D27] UNION select * from [10$E3:G27] UNION select * from [10$H3:J27] UNION select * from [10$K3:M27] UNION        select * from [11$B3:D27] UNION select * from [11$E3:G27] UNION select * from [11$H3:J27] UNION select * from [11$K3:M27] UNION        select * from [12$B3:D27] UNION select * from [12$E3:G27] UNION select * from [12$H3:J27] UNION select * from [12$K3:M27] UNION        select * from [13$B3:D27] UNION select * from [13$E3:G27] UNION select * from [13$H3:J27] UNION select * from [13$K3:M27] UNION        select * from [16$B3:D27] UNION select * from [16$E3:G27] UNION select * from [16$H3:J27] UNION select * from [16$K3:M27] UNION        select * from [17$B3:D27] UNION select * from [17$E3:G27] UNION select * from [17$H3:J27] UNION select * from [17$K3:M27] UNION        select * from [18$B3:D27] UNION select * from [18$E3:G27] UNION select * from [18$H3:J27] UNION select * from [18$K3:M27] UNION        select * from [19$B3:D27] UNION select * from [19$E3:G27] UNION select * from [19$H3:J27] UNION select * from [19$K3:M27] UNION        select * from [24$B3:D27] UNION select * from [24$E3:G27] UNION select * from [24$H3:J27] UNION select * from [24$K3:M27])
WHERE (编号 Is Not Null)
GROUP BY 编号, 名称
ORDER BY 编号

TA的精华主题

TA的得分主题

发表于 2010-2-27 13:47 | 显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件       ★免费下载 ★       ★ 使用帮助
晕,我写文章也写不了这么多字

TA的精华主题

TA的得分主题

 楼主| 发表于 2010-2-27 13:49 | 显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件       ★免费下载 ★       ★ 使用帮助
原帖由 pc520 于 2010-2-27 13:47 发表
晕,我写文章也写不了这么多字

谢谢兄弟,只是你的这个太复杂了点,公式什么的不能解决吗??

TA的精华主题

TA的得分主题

发表于 2010-2-27 13:55 | 显示全部楼层
公式,要写出来估计比我的复杂,而且也会很慢吧,建议找VBA 的高手弄........,他们厉害
或者你改变格式,我这要把你所有的表按不同区域连接起来,代码就得这么多。

TA的精华主题

TA的得分主题

发表于 2010-2-27 14:41 | 显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件       ★免费下载 ★       ★ 使用帮助
好像07也只能12个货架,多了就无法添加表

TA的精华主题

TA的得分主题

发表于 2010-3-5 09:43 | 显示全部楼层

我用字典做好了中午发给你!非常快的只要不到1秒就可实现

就是有10个区域也可以显示出来,昨天晚上做的放在家里了

TA的精华主题

TA的得分主题

发表于 2010-4-23 16:38 | 显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件       ★免费下载 ★       ★ 使用帮助
这么多工作表用SQL是有限制的,用VBA将其集中再简单透视即可实现汇总目的。

求助.rar

97.71 KB, 下载次数: 28

您需要登录后才可以回帖 登录 | 免费注册

本版积分规则

手机版|关于我们|联系我们|ExcelHome

GMT+8, 2024-11-28 23:41 , Processed in 0.045786 second(s), 10 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 1999-2023 Wooffice Inc.

沪公网安备 31011702000001号 沪ICP备11019229号-2

本论坛言论纯属发表者个人意见,任何违反国家相关法律的言论,本站将协助国家相关部门追究发言者责任!     本站特聘法律顾问:李志群律师

快速回复 返回顶部 返回列表