Hi all

i have been setting up a macro with the kind help of a forum member the past week and it now works great.

I am wanting to add a formula to my worksheet which I want in the macro, but I am having a bit trouble putting it together. It is as follows:

 =COUNTIFS('g2 graded'!$G$1:$G$20000, C2, 'g2 graded'!$D$1:$D$20000, 1)
I tried this, which is similar to my countif formlas in the macro but it doesnt work.

 Cells(x, 20).Value = Application.WorksheetFunction.CountIfs(Sheets("g2 graded").Range("g1:g30000"), Cells(x, 3), Sheets("g2 graded").Range("d1:d30000"), "1""")
Any help would be greatly appreciated. I have clicked solved on my previous thread regarding this as I think it may be better aswered on this forum. This was the previous thread:


http://www.excelforum.com/excel-prog...-to-vba-2.html

thanks
gemma