Getting multiple values between two different characters.

SpencerC

New Member
Joined
Dec 8, 2017
Messages
4
Hello all,

I have a list of values that look like this: ;Asphalt Late Model>Rear Suspension;Road Race>Rear Suspension


What I need to do is get all of the values between ; & >.


So in this example the output would be Asphalt Late Model;Road Race


Any help would be very appreciated, as I've been stuck on this one for a while.
 
Another macro solution
Code:
Sub t()
Dim c As Range, spl As Variant, i As Long, res As String
With ActiveSheet
    For Each c In .Range("A2", .Cells(Rows.Count, 1).End(xlUp))
        spl = Split(c.Value, ";")
        For i = LBound(spl) To UBound(spl)
            If spl(i) <> "" Then
                res = res & ";" & Left(spl(i), InStr(spl(i), ">") - 1)
            End If
        Next
        c.Offset(, 1) = res
        res = ""
    Next
End With
End Sub
 
Upvote 0

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

Forum statistics

Threads
1,224,827
Messages
6,181,198
Members
453,022
Latest member
RobertV1609

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top