Excel根据字体颜色或背景色求和

 时间:2024-10-16 16:12:05

1、 选择【开发工具】 点击【Visual Basic】

Excel根据字体颜色或背景色求和

3、写入代码Function SumByFontColorAndBGColor(Col As Range, SumRange As 伊怕锱鳏Range) '根据字体颜色及背景颜色求和Application.VolatileDim iCell As RangeSumByFontColorAndBGColor = 0For Each iCell In SumRange If iCell.Font.Color = Col.Font.Color And iCell.Interior.Color = Col.Interior.Color Then SumByFontColorAndBGColor = SumByFontColorAndBGColor + Application.WorksheetFunction.Sum(iCell) End IfNextEnd Function

4、 = SumByFontColorAndBGColor(A3,A1:A12)A3: 根据A3单元格的字体格式和背景色A1:A12:查找的范围。

Excel根据字体颜色或背景色求和
  • Excel2019中怎么创建组?
  • vba进行状态栏和编辑栏的设置
  • Excel如何对带同一种颜色的单元格分别进行求和?
  • Excel函数详解:[140]HYPERLINK函数用法
  • Excel2019版本在哪时设置允许后台检查错误
  • 热门搜索
    四川工商学院怎么样 尸王殿怎么去 罗曼罗兰简介 明星减肥食谱 吉林动画学院怎么样 跑步怎么调整呼吸 猎魂觉醒攻略 梦幻西游手游新手攻略 牛仔外套怎么搭配 怎么减肥不反弹