Re: PLEASE HELP!!!!



In one part, I see I didn't get eveything changed when I copied a line of
code

for i = 1 to ubound(vDat,1) Step 5
ii = 1
for j = i to i + 4
Name s1 & vDat(j,1) As s1 & ii & ".dat"
Name s2 & vDat(j,2) As s2 & ii & ".dat"
ii = ii + 1
Next j


should have had a .dat and a .txt


for i = 1 to ubound(vDat,1) Step 5
ii = 1
for j = i to i + 4
Name s1 & vDat(j,1) As s1 & ii & ".dat"
Name s2 & vDat(j,2) As s2 & ii & ".txt"
ii = ii + 1
Next j

I am not sure I follow all you are saying, but if you ran the first code I
gave you and changed all the file names to names like 1.dat and 1.txt, then
that could cause some duplicate filenames when combined with this code. I
saw this as handling the renaming. However, if you need to do the
renumbering first I would suggest you modify that original code to name the
files starting with an s1 & "A" & i & ".dat" as an example.


dkin also offers a workable approach for sorting the file names although I
suspect it is written for xl2007 and won't work (unchanged) in earlier
versions. It also doesn't implement 5 at a time or explicitly address the
2nd set of files. So you would still need to tie it all together.
--
Regards,
Tom Ogilvy




<s_smith_iet@xxxxxxxxxxx> wrote in message
news:1171115883.808738.67010@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Tom,

Thanks for your help
Now that it only deletes the 10 files (5 txt and 5 dat) I can keep all
of the files in those two folders with out transfering.
All of these files are on a server at work so I can get them droped
into those files instead.

The problem I am having know is the renaming.
You answered on of my first posts about remaming unknow files and the
macro renames the files 1-5000 (whatever amount I have in the folder)

here is the problem...... The first time I put in the files it works
then I delete the 5 files I have already used and when I go back to
rename them the second time it doesn't necessarily rename them 1-5 it
may go 1,4,6,8,9,23. It seems to be random which means that when my
macro searches for dat and txt files 1-5 it won't find them.

I am so close to perfecting this thing but at the same time I can't
see the light at the end of the tunnel.

Thanks for all your help




.



Relevant Pages

  • Re: PLEASE HELP!!!!
    ... Now that it only deletes the 10 files (5 txt and 5 dat) I can keep all ... of the files in those two folders with out transfering. ... macro renames the files 1-5000 ... rename them the second time it doesn't necessarily rename them 1-5 it ...
    (microsoft.public.excel.programming)
  • Re: Renaming Folders
    ... Good morning Douglas, ... sucessfully renamed the folders. ... I just tried to run the code to rename the folders in a drive. ... Set dbCurr = CurrentDb ...
    (microsoft.public.access.modulesdaovba)
  • Re: spaces at ends of filenames or directory names on Win32
    ... folders after stripping the whitespace... ... Does the rename work if try with other names? ... should note the the Windows GUI cannot rename the files. ...
    (comp.lang.python)
  • Re: Changing multiple file names
    ... Right click the first file and click Rename. ... For example, if you type Birthday, the other files in the ... files or folders, press and hold down CTRL, and then click each item. ...
    (microsoft.public.windowsxp.basics)
  • Re: Cant access email
    ... To attempt to resolve this behavior, remove the possibly damaged .dbx file: ... In Windows Explorer, on the Tools menu, point to Find, and then click ... You may need to include hidden files and folders. ... and then click Rename. ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)