Good Morning,
I have some data below
A1 -> TEST - 123 - 965A
A2 -> TEST - 111 - 656 - 965ASD
I need to break it so it looks like this
B1 -> 965A
B2 -> 965ASD
I need to fetch the 20 characters after the last "-"
Can be VBA or formula.
Good Morning,
I have some data below
A1 -> TEST - 123 - 965A
A2 -> TEST - 111 - 656 - 965ASD
I need to break it so it looks like this
B1 -> 965A
B2 -> 965ASD
I need to fetch the 20 characters after the last "-"
Can be VBA or formula.
Option Explicit Sub test() Dim c As Range Dim s For Each c In Columns(1).SpecialCells(2) s = Split(c.Value, "-") c.Offset(, 1).Value = s(UBound(s)) Next End Sub
Good code, mana.
But I would use spaces around the dash in the Split parameterOr Trim the returns = Split(c.Value, " - ")Probably best to Trim the return so some typo leaving out the Space won't kill the code.s = Trim(Split(c.Value, "-"))
I expect the student to do their homework and find all the errrors I leeve in.
Please take the time to read the Forum FAQ
Good afternoon,
Thank you very much, it was very good.