收藏 分享(赏)

Excel2007中按单元格颜色求和的自定义公式.doc

上传人:gnk289057 文档编号:4556546 上传时间:2019-01-02 格式:DOC 页数:1 大小:23.50KB
下载 相关 举报
Excel2007中按单元格颜色求和的自定义公式.doc_第1页
第1页 / 共1页
亲,该文档总共1页,全部预览完了,如果喜欢就下载吧!
资源描述

1、一在 Excel2007 中按单元格颜色求和按字体颜色求和,经过测试(在 Excel2003 和 2007 中),非常好用,整理出来,与大家分享:Excel 本身没有这个功能,可用以下办法实现:打开你的工作表:点工具-宏-Visual Basic 编辑器,在左边最上一行点右键-插入- 模块,然后在打开的编辑框中粘贴以下代码:Function CountColor(col As Range, countrange As Range) As IntegerDim icell As RangeApplication.VolatileFor Each icell In countrangeIf ice

2、ll.Interior.ColorIndex = col.Interior.ColorIndex ThenCountColor = CountColor + 1End IfNext icellEnd FunctionFunction SumColor(col As Range, sumrange As Range) As IntegerDim icell As RangeApplication.VolatileFor Each icell In sumrangeIf icell.Interior.ColorIndex = col.Interior.ColorIndex ThenSumColor = Application.Sum(icell) + SumColorEnd IfNext icellEnd Function然后关闭,反回到工作表,点击-工具-选项-安全性-宏安全性- 安全级选-低- 确定保存关闭工作表,然后再打开,这时就可以用了

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 实用文档 > 办公软件应用

本站链接:文库   一言   我酷   合作


客服QQ:2549714901微博号:道客多多官方知乎号:道客多多

经营许可证编号: 粤ICP备2021046453号世界地图

道客多多©版权所有2020-2025营业执照举报