excel vba求和加单元格个数

excelVBA

1个回答

写回答

764268126

2026-01-30 09:58

+ 关注

AI
AI

Sub calculation()Dim range As RangeSet range = Range("c13:i", n)For Each cell In rangeIf cell.Interior.ColorIndex = 5 Thenj = j + 1k = k + cellEnd IfNextIf j < 2 ThenMsgBox "There are less than or equal to 2 blue cells."Else[a7] = k Mod 10End IfEnd SubNote: In the original text, there is no specific instruction for the calculation of [a7]. Therefore, I have left it blank. Please provide more detAIls if you need it.

举报有用(18分享收藏

Copyright © 2025 IZhiDa.com All Rights Reserved.

知答 版权所有 粤ICP备2023042255号