Unanswered: problem with single quotes used in formatting reports
I'm trying to export a table from access into excel. I'm having some problems with the following code:
.Range("E" & endrownum).Select
.ActiveCell.FormulaR1C1 = "=COUNTIF(E2:E" & endrownum & ",1)"
When the report opens up in excel, this is how the cell looks like:
I need to lose the single quotes...
I've also got another countif statement that I need help with:
.ActiveCell.FormulaR1C1 = "=COUNTIF(H2:H" & endrownum & ",'<>0'" & ")"
I tried various other forms for the quotes around <>0, but nothing seems to work. I need the cell to look like this in excel:
using endrownum instead of 47, and double-quotes encompassing <>0. How do I get the cell to look like the above?