Home > front end >  Remove unwanted text from Data
Remove unwanted text from Data

Time:02-26

How would I go about removing unwanted text from data that is pull from a website. I have a macro that will pull data from a website but it comes in like this.

Jerry Smith / 193640 / main

Morty Smith / 847478 / main

Rick Sanchez / 747264 / main

Scary Terry / 726950 / side

Ect.

I want to have just the names not the numbers or main/side.

CodePudding user response:

Try the code

Sub Test()
    Dim rng As Range
    Set rng = Range("A1:A" & Cells(Rows.Count, 1).End(xlUp).Row)
    rng.Offset(, 1).Value = Evaluate("IF({1},LEFT(" & rng.Address(0, 0) & ",SEARCH("" / ""," & rng.Address(0, 0) & ",1)-1))")
End Sub
  • Related