MP3 Change Filename

kindi1000

New Member
Joined
May 2, 2005
Messages
26
I have a macro which changes the names of songs, but it cannot change the names of particular songs because it cannot find them. The reason being - the filename uses a symbol which is not recognized by vb. Is there a way to only search the first 40 characters of a song title and save it by that new name (i.e.: leave only the first 40 characters of the name as the name)? An example of a title is:

003 - Rihanna ft. Jay-Z - Umbrella [Torrent-Tatty] (� IDJMG).MP3

The questionmark symbol shows up as an unidentifiable symbol. There are a lot of spaces in the file name. Thanks.
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
That's an interesting one, vb should be able to read/write the full unicode set even if excel doesn't display it right. Care to post the macro, might be to just debug it a little.
 
Upvote 0
Thanks. The macro is as follows:

Sub CopyMP3()
Dim oFileName As Variant
Dim nFileName As Variant
Dim i As Variant

Range("B11").Select
i = 1
Do While ActiveCell.Offset(i, -1).Value <> ""
If ActiveCell.Offset(i, -1).Value <> "" Then
oFileName = ActiveCell.Offset(i, -1).Value
nFileName = ActiveCell.Offset(i, 0).Value
FileCopy oFileName, nFileName
End If

i = i + 1
Loop
End Sub


I basically rename a file based on a new filename, but VB could need read the "?" symbol in the original filename. Thanks.
 
Upvote 0
Eh, that's not renaming a file - it's copying a file.:eek:

It's probably difficult to pinpoint a particular file without the exact name.

Is there any naming convention for either the old filename or the new filename?

Are all the files in the same directory?
 
Upvote 0
you may need to look at each character in the string and look at it's ASCII value and change certain one into blanks or underscores or something like that.
 
Upvote 0
True - but the way I rename is to copy in case I mess something up. There is naming convention, but that is done within Excel - but I think we could probably ignore that for now. All the files are in the same directory. If you think that renaming rather than copying would make my life easier, then I'm all for that. Thanks.
 
Upvote 0
Why ignore the naming convention if it might help?:unsure:
 
Upvote 0
Ok. The naming convention I use is:

Lets take the following filename:
003 - Rihanna ft. Jay-Z - Umbrella [Torrent-Tatty] (� IDJMG).MP3

I would change it to:
Rihanna ft. Jay-Z - Umbrella.MP3

Thanks.
 
Upvote 0

Forum statistics

Threads
1,214,397
Messages
6,119,271
Members
448,882
Latest member
Lorie1693

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