Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
rename unknown named files
I have a bunch of different macros that are working at the moment the
only problem is that they will only work for a certain named file. what I think would be the easiest way to make this work is to rename the files in the folders. these are the two folders which have the files I need to rename C:\Documents and Settings\Owner\My Documents\Work\P123\dat C:\Documents and Settings\Owner\My Documents\Work\P123\txt Each folder would have 10 files in them at a time. I would like to name them 1-10 dat and 1-10 txt if possible. Any ideas??? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
rename unknown named files
Sub RenameFiles()
s1 = "C:\Documents and Settings\Owner\My Documents\Work\P123\dat\" s2 = "C:\Documents and Settings\Owner\My Documents\Work\P123\txt\" sName = dir(s1 & "*.*") i = 0 do while sName < "" i = i + 1 name s1 & sname as s1 & i & ".dat" sName = dir() Loop sName = dir(s2 & "*.*") i = 0 do while sName < "" i = i + 1 name s2 & sname as s2 & i & ".txt" sName = dir() Loop End Sub -- Regards, Tom Ogilvy wrote in message oups.com... I have a bunch of different macros that are working at the moment the only problem is that they will only work for a certain named file. what I think would be the easiest way to make this work is to rename the files in the folders. these are the two folders which have the files I need to rename C:\Documents and Settings\Owner\My Documents\Work\P123\dat C:\Documents and Settings\Owner\My Documents\Work\P123\txt Each folder would have 10 files in them at a time. I would like to name them 1-10 dat and 1-10 txt if possible. Any ideas??? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
rename unknown named files
Amazing!!!!!!!!!!!
Thank you sooooo very much Now what would I need to change if I wanted to use the same thing to 20,30 or more files? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
rename unknown named files
nothing as long as they are named in numerical sequence from 1 to N
-- Regards, Tom Ogilvy wrote in message ups.com... Amazing!!!!!!!!!!! Thank you sooooo very much Now what would I need to change if I wanted to use the same thing to 20,30 or more files? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Unknown excel backup files created in network directory | Excel Discussion (Misc queries) | |||
Help to rename files | Excel Worksheet Functions | |||
Macro to add cells from unknown number of files | Excel Programming | |||
Rename Files | Excel Programming | |||
FTP Accessing remote files where filenames are unknown | Excel Programming |