How to remove last comma in a given string?
<p>I tried with below code, but unable to remove comma. Please help.</p>

<pre><code>Sub removelastcommas()

    Dim i As Integer, str As String

    str = Range("A1")

    For i = Len(str) To 1
        If Mid(str, i, 1) &lt;&gt; "," Then
            Exit For
        End If
    Next
    Range("b1") = Left(str, i)

End Sub
</code></pre>