Seems I've slept a few times since you last updated the thread
Last cell ... last row ... whatever. The code determines the last row of data of data on Sheet BDC2 based on column E:
Your code, in the original post:
generates this formula:
So, if I edit that to match the structure in the sample workbook, with sheet BDC2, thus:
it generates this formula:
Note that, in both cases, the range to be summed is different to the criteria ranges ... the range to be summed includes only rows 2:3, whereas the criteria ranges include rows 2:2033.
The amended code that I provided first determines the number of rows on sheet BDC2 and then uses that in generating the formula:
It determines the last row of data on Sheet BDC2 which, in your sample workbook, is 6.
Hence, this gives:
As you can see, this uses rows 2:6 for the range to be summed and for the criteria range(s)
This returns a value of 0 because column AE has no values/data in it.
Not sure what it is you are looking for.
Bookmarks