Remove characters from a file name

gtd526

Well-known Member
Joined
Jul 30, 2013
Messages
657
Office Version
  1. 2019
Platform
  1. Windows
Hello,
How to remove characters from beginning of a file in a certain folder?
I can identify the folder from a cell. (myPath="A1")
File Name (example):
07. White Knuckles.mp3
07 White Knuckles.mp3
7 White Knuckles.mp3

Maybe removing from the first space and backwards?
Thank you.
 
Glad we could help & thanks for the feedback.
 
Upvote 0

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Glad we could help & thanks for the feedback.
One more question :)
How can I add a "\" (backslash) to the end of a folder name.
I have a folder name in E1, but need that backslash for macro to work.
Replace Files.xlsm
DE
1Folder To Fetch:C:\Users\Greg\Music\Five Finger Death Punch\Test
Sheet1


I have 3 macros for changing the file name. 1. Get file name from folder 2. Make changes of file name 3. send changed file name to folder.
I'm putting it together in 1 macro.
I will let you know how it works out.
 
Upvote 0
As that is a totally different question, you will need to start a new thread.
 
Upvote 0
Here are my results.
Replace Files.xlsm
AB
1Old File NameNew File Name
21 Intro.mp3#VALUE!
302. Under And Over It.mp3#VALUE!
403. Burn It Down.mp3#VALUE!
504. American Capitalist.mp3#VALUE!
605. Hard To See.mp3#VALUE!
706. Coming Down.mp3#VALUE!
807. Bad Company.mp3#VALUE!
908. White Knuckles.mp3#VALUE!
1009. Drum Solo.mp3#VALUE!
1110. Far From Home.mp3#VALUE!
1211. Never Enough.mp3#VALUE!
1312. War Is The Answer.mp3#VALUE!
1413. Remember Everything.mp3#VALUE!
1514. No One Gets Left Behind.mp3#VALUE!
1615. The Bleeding.mp3#VALUE!
Sheet1
Cell Formulas
RangeFormula
B2:B16B2=REPLACE(A2,1,FIND(" ",A2),"")
Yes. Your formula is working. I restarted my computer and tried it again, and it works.
Why it didn't at first, I don't know. I blame the AMD processor, not Intel??
 
Upvote 0
Thanks for letting us know.
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,693
Members
448,979
Latest member
DET4492

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