Hi,
I am trying to change some formula in my file with VBA calculations, but as the formula is bit complex, have troubles expressing it in VBA. Result of the formula should be count of all projects started this month from 2 sheets different than the one it is present in. Formula in sheet works perfect.
Formula in sheet is:
Have tried to simply put it in VBA as:
But i get Compile error:expected end of statement.
Any help is greatly appreciated.
I am trying to change some formula in my file with VBA calculations, but as the formula is bit complex, have troubles expressing it in VBA. Result of the formula should be count of all projects started this month from 2 sheets different than the one it is present in. Formula in sheet works perfect.
Formula in sheet is:
Code:
COUNTIFS('VAT registrations'!M:M,">="&EOMONTH(TODAY(),-1)+1,'VAT registrations'!M:M,"<"&EOMONTH(TODAY(),0)+1,'VAT registrations'!E:E,"Registration")+COUNTIFS(Archive!L:L,">="&EOMONTH(TODAY(),-1)+1,Archive!L:L,"<"&EOMONTH(TODAY(),0)+1,Archive!E:E,"Registration")
Have tried to simply put it in VBA as:
Code:
Worksheets("Summary").Range("C18").Formula = "=COUNTIFS('VAT registrations'!M:M,">="&EOMONTH(TODAY(),-1)+1,'VAT registrations'!M:M,"<"&EOMONTH(TODAY(),0)+1,'VAT registrations'!E:E,"Registration")+COUNTIFS(Archive!L:L,">="&EOMONTH(TODAY(),-1)+1,Archive!L:L,"<"&EOMONTH(TODAY(),0)+1,Archive!E:E,"Registration")"
But i get Compile error:expected end of statement.
Any help is greatly appreciated.