ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   If Then Loop.... (https://www.excelbanter.com/excel-programming/375626-if-then-loop.html)

[email protected]

If Then Loop....
 
So I'm new to VBA, and am working on my first loop. I have names in
column A, Dates in Column B, and Quantity in Column C. I need to create
a loop that provides me with the sum of the quantities for each name,
between certain dates.

ie: If name = Steve, then sum, if not, offset to next cell down. Then
put the total of all the quantities for Steve in cell A1.

Thanks for the help!


Dave Peterson

If Then Loop....
 
You may want to experiment with data|Pivottable. And if you need to have it
mechanized, you could record a macro when you do it manually.



wrote:

So I'm new to VBA, and am working on my first loop. I have names in
column A, Dates in Column B, and Quantity in Column C. I need to create
a loop that provides me with the sum of the quantities for each name,
between certain dates.

ie: If name = Steve, then sum, if not, offset to next cell down. Then
put the total of all the quantities for Steve in cell A1.

Thanks for the help!


--

Dave Peterson

Dave Peterson

If Then Loop....
 
ps. I'd even cheat and add another column to the data that added a formula that
evaluated to a Y or N according to the date.

wrote:

So I'm new to VBA, and am working on my first loop. I have names in
column A, Dates in Column B, and Quantity in Column C. I need to create
a loop that provides me with the sum of the quantities for each name,
between certain dates.

ie: If name = Steve, then sum, if not, offset to next cell down. Then
put the total of all the quantities for Steve in cell A1.

Thanks for the help!


--

Dave Peterson


All times are GMT +1. The time now is 10:18 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com