Background
- I am using Excel 2003
- The data is organized in Table format (500 rows x N column),
1st column is the ending date of each month
2nd column is the year of the date in 1st column
2nd column is sale per month
3rd column is expense per month
I use sumproduct function to calculate the Total Amount for each item in the Table as set out below
'=IF(ISERROR(SUMPRODUCT(--(rng_colltrlDates<=gbl_SecEndDate),--(rng_colltrlDates>=gbl_OrigDate),--(rng_colltrlYear=D$5),PLTax.EIR.IntlMrtgEIRincome)),"error",SUMPRODUCT(--(rng_colltrlDates<=gbl_SecEndDate),--(rng_colltrlDates>=gbl_OrigDate),--(rng_colltrlYear=D$5),PLTax.EIR.IntlMrtgEIRincome))
Goals
I am thinking of doing the above calculation in vba by using user defined function. This is :
1) to make the spreadsheet looks neater and the formula is less intimating.
2) to handle the error in vba and
3) to make the calculation speed will be faster.
Thanks in advance for your guidance.
Bookmarks