2
我嘗試使用下面的代碼,但無法刪除逗號。請幫忙。如何刪除給定字符串中的最後一個逗號?
Sub removelastcommas()
Dim i As Integer, str As String
str = Range("A1")
For i = Len(str) To 1
If Mid(str, i, 1) <> "," Then
Exit For
End If
Next
Range("b1") = Left(str, i)
End Sub
' = SUBSTITUTE(A1, 「」, 「」,LEN(A1)-LEN(SUBSTITUTE(A1, 「」, 「」)))' –