I have the following formula in a database worksheet cell, =SUMIFS($N$2:$N$1048571,$T$2:$T$1048571,$AD2,$S$2:$S$1048571,"Utilities"). It works in my worksheet(Sheet2) and populates the data to my Dashboard. My problem is this: When I start a new month erasing all the data in my user form database, the values in sheet 2 are cleared. As a result Cells J17, M17 and N17 show !#Ref because cells AC2, AE2 and AF2 are now empty. I'm not sure how to fix this. I'm also wondering how to code the above formula in excel vba.
I tried this, but it didn't work
Sub Formula_BudgetTotals()
'Assigns hard code formula to a single cell.
Range("AC2").Formula = "=SUMIFS($N$2:$N$1048571,$T$2:$T$1048571,$AD2,$S$2:$S$1048571,"Utilities")"
End Sub
Hope I explained it well enough.
I tried this, but it didn't work
Sub Formula_BudgetTotals()
'Assigns hard code formula to a single cell.
Range("AC2").Formula = "=SUMIFS($N$2:$N$1048571,$T$2:$T$1048571,$AD2,$S$2:$S$1048571,"Utilities")"
End Sub
Hope I explained it well enough.