Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Remove unwanted text from Data

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

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Rick Sanchez / 747264 / main

Scary Terry / 726950 / side

Ect.

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

>Solution :

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
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading