Option Explicit
Dim LenField, Start
Function getFirstBit(OldValue)
If InStr(1, OldValue, ",") Then
LenField = InStr(1, OldValue, ",") - 1
getFirstBit = Trim(Mid(OldValue, 1, LenField))
Else
getFirstBit = "ERROR"
End If
End Function
Function getSecondBit(OldValue)
If InStr(1, OldValue, ",") Then
Start = InStr(1, OldValue, ",") + 1
LenField = Len(OldValue) - InStr(1, OldValue, ",")
getSecondBit = Trim(Mid(OldValue, Start, LenField))
Else
getSecondBit = "ERROR"
End If
End Function