VBA Count how many times a text appears
<p>I tried to use the formula to count how many times "s" appears from D1 to Dj, but I keep getting error on </p>

<pre><code>nS = Application.WorksheetFunction.CountIf(Worksheets(i).Range(Cells(1, 4)
</code></pre>

<p>the subject is like</p>

<pre><code> Public Sub check()
                Dim nS As Integer
                Dim j As Integer
                Dim Row_Count As Integer
                Dim i As Integer
                j = Row_Count + 53
                nS = Application.WorksheetFunction.CountIf(Worksheets(i).Range(Cells(1, 4), Cells(j, 4)), "s")
                MsgBox "nS=" &amp; nS
                MsgBox "D" &amp; j
End Sub
</code></pre>

<p>And the first MsgBox keeps showing nS=0</p>