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版本在哪时设置允许后台检查错误
  • 热门搜索
    怎么减脂肪 被蜘蛛咬了怎么办 怎么在网上卖东西 鬼鲛怎么死的 怎么充话费 海尔空调怎么样 卤味怎么做 紫菜蛋花汤怎么做 六角恐龙怎么养 小米手环怎么样