Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

Remove After Certain Chars

0

Hiya All

First post here, I have an excel workbook listing all my albums but they are listed into tracks

Is there a way please to remove everything after the 5th backslash as in

R:\1-9\ARTISTS ALBUMS\3.2\The Rules Have Changed\01 - One by One.mp3

to leave just

R:\1-9\ARTISTS ALBUMS\3.2\The Rules Have Changed\

I have a lot of data that I need this applying too

Regards

Steve

Answer
Discuss

Answers

0
Selected Answer

Hi and welcome)

Try this formula:

=LEFT(A1,FIND("~",SUBSTITUTE(A1,"\","~",5)))

It will work so long asĀ ~ is not in any of the text in the list - if the squiggle is in the text, then use a character that will never appear in the list.

Discuss

Discussion

Thank you so much
Smudger (rep: 2) Aug 6, '19 at 1:29 am
Add to Discussion


Answer the Question

You must create an account to use the forum. Create an Account or Login