SUMIFs使用Excel VBA [英] SUMIFs using Excel VBA

查看:762
本文介绍了SUMIFs使用Excel VBA的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法理解VBA中的SUMIF的概念,有人可以剖析以下代码?

 如果WorksheetFunction.SumIf (ActiveSheet.Columns(3),Range(C&6)。Value,ActiveSheet.Columns(9))/ WorksheetFunction.CountIf(ActiveSheet.Columns(3),Range(C&6 ).Value)= Range(I&6)。然后


解决方案

这部分: -

  SumIf(ActiveSheet.Columns(3),Range &6)。Value,ActiveSheet.Columns(9))

: -



将第一列(第9列)中的所有值添加到单元格C6中的值出现在列C(第3列)的相应行中。

  SUMIF(包含搜索列)价值,要搜索的值,列附加项添加)

希望这有帮助。


I am not able to comprehend the concept of SUMIFs in VBA can someone dissect the following code?

If WorksheetFunction.SumIf(ActiveSheet.Columns(3), Range("C" & "6").Value, ActiveSheet.Columns(9)) / WorksheetFunction.CountIf(ActiveSheet.Columns(3), Range("C" & "6").Value) = Range("I" & "6").Value Then 

解决方案

This part:-

SumIf(ActiveSheet.Columns(3), Range("C" & "6").Value, ActiveSheet.Columns(9))

Basically reads like this:-

Add together all the values in Column I (9th column) where the value in Cell C6 appears in the corresponding row in Column C (3rd column).

SUMIF broken down looks like this:-

SUMIF(Column containing search values, value to search for, column conaintining items to add)

Hope this helps.

这篇关于SUMIFs使用Excel VBA的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆