Quote:
ApExcel.Worksheets(1).Cells(1, 19) = "=COUNT(c[-18])";
First of all this code have a problem. An Excel cell is an object, you can't store a string in it and expect anything go right.
To store a formula in the cell, you need to say it.
ApExcel.Worksheets(1).Cells(1, 19).FormulaR1C1 = "=COUNT(c[-18])";
Quote:
what "=COUNT(c[-18])" this mean
This is an Excel formula using the R1C1 relative notation.
Excel VBA FormulaR1C1 Property - Easy Excel Macros[
^]
Excel – R1C1 Reference Style vs. A1 | Excelmate[
^]