0

Trying to write in the cell the following code, using VBA:

=countif(Table1[@[Jan]:[Dec]];"<>0")

I've tried both ways I found on stackoverflow:

=countif(Table1[@[Jan]:[Dec]];""<>0"")
=countif(Table1[@[Jan]:[Dec]];" & Chr(34) & "<>0" & Chr(34) & ")

Neither of them worked. Any ideas?

Mathieu Guindon
  • 69,817
  • 8
  • 107
  • 235
Igor
  • 913
  • 1
  • 8
  • 18
  • 6
    That doesn't look like VBA. It looks like a cell formula. At any rate. `=countif(Table1[@[Jan]:[Dec]];"""<>0""")` or `=countif(Table1[@[Jan]:[Dec]];chr(34) & "<>0" & chr(34))` should work – JNevill Apr 11 '19 at 21:13
  • `cell.formula = "=countif(Table1[@[Jan]:[Dec]];""<>0"")"` – tigeravatar Apr 11 '19 at 21:27

0 Answers0