Hey Guys,
I was just trying to put a formula into a cell:
Formula:
=COUNTIF(STATEMENT!M:M,"cancelled")
VBA Code:
I can get it going if I change it to:
c = "=COUNTIF(STATEMENT!M:M,cancelled)"
But then the formula doesn't work.
Any ideas guys?
Cheers
I was just trying to put a formula into a cell:
Formula:
=COUNTIF(STATEMENT!M:M,"cancelled")
VBA Code:
Code:
Sub test()
Dim strsource As String
Dim c As String
c = '=COUNTIF(STATEMENT!M:M,"cancelled")'
strsource = "Reference"
Application.Worksheets(strsource).Range("N1").FormulaLocal = c
End Sub
I can get it going if I change it to:
c = "=COUNTIF(STATEMENT!M:M,cancelled)"
But then the formula doesn't work.
Any ideas guys?
Cheers