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版本在哪时设置允许后台检查错误
  • 热门搜索
    惠州博物馆 行间距怎么调 win7怎么设置密码 喧闹的近义词是什么 小孩的发型 忐忑不安的近义词 营业执照丢失怎么补办 我的世界怎么驯服僵尸 韩式新娘发型 脚脱皮怎么办