Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In a spreadsheet called FileList I have a list of files in Col A like this:
C:\Documents and Settings\##My Documents\My Things\Blah Blah Blah\Folder_2\01 Filename In Col B I have the new file names like this: C:\Documents and Settings\##My Documents\My Things\Blah Blah Blah\Folder_2\01 New Filename I want to replace all the file names in Col A with the new file names in Col B so the file name in A2 would be replaced by B2 etc. How do I make my macro Name OldFileName as NewFileName through each row in the 2 lists? Any help would be much appreciated Many thanks Kewa |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Kewa
The basic code looks like this Maybe it is better to test if the file in A exist before you rename it ? For Each cell In Columns("A").SpecialCells(xlCellTypeConstants) Name cell.Value As cell.Offset(0,1).Value Next cell -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "nospaminlich" wrote in message ... In a spreadsheet called FileList I have a list of files in Col A like this: C:\Documents and Settings\##My Documents\My Things\Blah Blah Blah\Folder_2\01 Filename In Col B I have the new file names like this: C:\Documents and Settings\##My Documents\My Things\Blah Blah Blah\Folder_2\01 New Filename I want to replace all the file names in Col A with the new file names in Col B so the file name in A2 would be replaced by B2 etc. How do I make my macro Name OldFileName as NewFileName through each row in the 2 lists? Any help would be much appreciated Many thanks Kewa |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Many thanks Ron. That works a treat.
Kewa |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Renaming files in a directory | Excel Programming | |||
Maintain cell links when renaming directory containing multiple f | Excel Worksheet Functions | |||
Renaming adding and deleting directory | Excel Programming | |||
Renaming all files in a directory | Excel Programming | |||
Check if directory empty OR no of files in directory. | Excel Programming |