![]()
Public Function NumComma(ByRef cell As Range) As String Dim tmp As String Dim ary As Variant Dim pos As Long Dim i As Long, ii As Long ary = Split(cell.Value, ",") For i = LBound(ary) To UBound(ary) pos = InStr(ary(i), "-") If pos > 0 Then For ii = Left$(ary(i), pos - 1) To Mid$(ary(i), pos + 1, 99) tmp = tmp & ii & "," Next ii Else tmp = tmp & ary(i) & "," End If Next i NumComma = Left$(tmp, Len(tmp) - 1) End Function
Bookmarks