In my one module i have written as
Range("D9").Formula = "=sum(c1:indirect(C&counta(C:C)))" , but when i run it in D9 it shows
=SUM($A:$A:INDIRECT(D:D&COUNTA(D:D)))

I have tried one more way
Range("D9").Formula = "=sum(c1:Range(c & Rows.Count).End(xlUp).Row)"
but this also does not work.

Please help me with correction