You can use one of the following lines of code:
The first one will count how many cells are in column A. If you have data in rows 1-20, but you have a blank cell in row 10, then it will return 19.
The second one tells you the lowest used row in column A. So in the above scenario it would still tell you 20. It would probably be better for your purposes.
I'm still not sure why you need to do the part with the sum and divide by 3; doesn't the moving average trendline do the same thing? Try this code:
Or, if you want both trendlines in one chart, that can be arranged as well.
As for not being able to access your module... what do you mean exactly? you push Alt+F11, and what do you see?
-Joe
Bookmarks