Hi, I am new to VBA but have some familiarity with programming.
I am trying to average a set of values based on the date the values were entered for each unique date. I am keeping a count and running total as my program looks through the data for each date that is the same as the previous (then dividing the "running total" by "count") to get the average). I am then trying to output this info in 2 columns - date and average value.
I think the main problem is that I am trying to store the running total in a cell and then do math on it (based on what I could find on the error code given and other forums). But I can't seem to store the cell value in a variable either so I don't know the best practice or work around for this. Full code below, but I think the main problem is these two lines:
Cells(k, 12).Value = Cells(k, 12).Value + Cells(i, 6).Value
...
Cells(k, 12).Value = Cells(k, 12).Value / count
Where k and i are iterative variables for the row.
Thanks!![]()
Please Login or Register to view this content.
Bookmarks