Welcome to the MrExcel board!I am trying to extract the digits after the '-' in this type of data 236-1,46-2,jm007-6,893-2.
Any help would be appreciated.
What does that mean, it is still not clear. Remember, we cannot see your worksheet. If you don't show us then you have to tell us exactly what is in each cell.No it is not blue text just standard.
At last, thank you.It is currently in a single cell
Function DashSum(s As String) As Single
Dim Bits
Dim i As Long
Bits = Split(s, ",")
For i = 0 To UBound(Bits)
DashSum = DashSum + Split(Bits(i), "-")(1)
Next i
End Function
Excel Workbook | ||||
---|---|---|---|---|
A | B | |||
1 | ||||
2 | 236-1,46-2,jm007-6,893-2 | 11 | ||
3 | 236-865 | 865 | ||
4 | fff-0,46-9 | 9 | ||
Sheet1 |