Having trouble with a count if statement. The file is linked to a live database. I have subtotals and counts for each change in column C. What I currently have works fine has a regular count, but I would like to count only non zero cells in column D but keep getting compilation errors. Here is what works as a regular count...
and here is an example of my attempt:wssheet.Cells(currRow + 2, 4) = "=Counta(D" + Format(startRow) + ":D" + Format(currRow) + ")"
wssheet.Cells(currRow + 2, 4) = "=CountIF(D" + Format(startRow) + ":D" + Format(currRow) + ",’>0’)"
Hi,
Would this do what you require?
wssheet.Cells(currRow + 2, 4).Formula = "=COUNTIF(D" & Format(startRow) & ":D" & Format(currRow) &","">0"")"
Please disregard anything in the above post. It may well have been edited without my consent, as has been the case with several posts and threads recently.
Perfect. Thank you for such a quick response.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks