Count the status messages in a column VBA
Don't reinvent the wheel. Your homemade function will never be as fast as the built in functions.
Function UploadStatus(ByRef WS As Worksheet, ByVal StartRow As Long, ByVal EndRow As Long, Optional ByVal strMsg As String) As String
  Dim OK As Long
  Dim NOK As Long
  Dim uploadMsg As String
 
  If StartRow = 0 And EndRow = 0 Then 
    Exit Function
  End If
  
  OK = WorksheetFunction.CountIf(&quot;A&quot; &amp; StartRow &amp; &quot;:A&quot; &amp; EndRow, &quot;OK&quot;)
  NOK = WorksheetFunction.CountIf(&quot;A&quot; &amp; StartRow &amp; &quot;:A&quot; &amp; EndRow, &quot;NOK&quot;)

  uploadMsg = ResultStringer(OK &amp; &quot;OK&quot;)
  uploadMsg = uploadMsg &amp; ResultStringer(NOK &amp; &quot;NOK&quot;)
 
  If strMsg &lt;&gt; vbNullString Then
    UploadStatus = strMsg &amp; &quot; &quot; &amp; uploadMsg
  Else
    UploadStatus = uploadMsg
  End If

End Function

Private Function ResultStringer(ByVal Count As Long, ByVal ID as String) as String

  If Count &gt; 1 Then
    ResultStringer = Count &amp; ID &amp; &quot; rows, &quot;
  Else
    ResultStringer = Count &amp; ID &amp; &quot; row, &quot;
  End If

End Function