Thanks for the replies. I will follow the rules from now on. I managed to get the following to work:
Sub ColumnData()
'">" & CDbl(InputDate),
Dim InputDate As Date
InputDate = InputBox("Enter Key Date")
'Function to Countif (TEST)
MsgBox CDate(InputDate)
'Function to Countif (DATES)
Range("C1").End(xlDown).Offset(1, 0).Formula = Application.WorksheetFunction.CountIf(Range("G3:G50"), ">" & CDbl(InputDate))
End Sub
I would like to add another 'IF' statement to this so I adapted the line of code to the following
Range("C1").End(xlDown).Offset(1, 0).Formula = Application.WorksheetFunction.CountIfs(Range("G3:G50"), ">" & CDbl(InputDate), Range("E1:E20"), "X1")
I now recieve the dreaded Run-time error '1004': Unable to get the countifs property of the WorksheetFunction class. Any ideas where I am going wrong?
Thanks
Bookmarks