用于Excel的VB代码 [英] VB Code for Excel
问题描述
在A栏中我有一个物品代码,在AA栏中我有一个amout。 我想将列AA的值放在AB列中。
如果项目代码在A列中出现多次,则必须为该代码添加AA列的总数并放入列AB中的总计。
如果项目代码仅使用嵌套的IF语句出现两次,我设法得到了这个,但是如果项目代码出现两次以上,但没有得到正确答案。 我使用的IF声明是: = IF(A70 = A71,AA70 + AA71,IF(A71<> A70,",AA71))
我应该使用宏来执行此操作以及代码是什么样的?
请注意这是VB的开发人员论坛for net。
试试它是答案论坛
http://answers.microsoft.com
&NBSP;
In column A I have an item code and in column AA I have an amout. I want to put the value of column AA in column AB.
If an item code appears more than once in column A it has to add up the totals of column AA for that code and put the total in column AB.
I managed to get this if the item code only appears twice with a nested IF statement, but if the item code appears more than twice it do not get the correct answer. The IF statment that I used is: =IF(A70=A71,AA70+AA71,IF(A71<>A70,"",AA71))
Should I use a macro to do this and what would the code look like?
Be aware this is a developers forum for VB for Net.
Try it is the answer forums
http://answers.microsoft.com
这篇关于用于Excel的VB代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!