How to use countif in a formula
I did some research on google and other forums but did not find a solution. it's not a syntax error so it's not my double quotes that is the issue. the error is run time 1004, application defined or object defined error.
Cells(a, 1).Formula = "=Countif(Range(cells(" & a & ",7),cells(" & a & ",21))),""a"""
In the first case, a is 5, so i want it to scan columns g through u in row 5, count any occurrences of the letter 'a'
Expected a number counting all the occurences of "a" in a row, instead im getting a 1004 error
just a note to the moderators, on my last post, i was demoted i guess for asking a dumb question. how can i get that fixed as the thread is closed.
RangeandCellsin a worksheet formula? Are you not looking to useApplication.WorksheetFunction.CountIf? Or are you trying to populate a cell with a formula?