ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Loop through all files on a floppy drive (https://www.excelbanter.com/excel-programming/337444-loop-through-all-files-floppy-drive.html)

ED007

Loop through all files on a floppy drive
 
I posted the question below in the general threads but thought it might be
better placed here.

I have some equipment that periodicaly records some data to disk.
Unfortunatly each time it records the data it creates a new file and records
a great deal of extranious data. I use sneaker net to transfer the files to
my PC. I can open each file (theyare text), and have written a macro to
extract the data needed and place it in an excel sheet in order. However, I
must open each file change its name to the name used in the macro and run the
macro. This is almost as big a pain as printing each file and copying the
data by hand.

I see that there is a For Each ... Next structure in visual basic, but the
only example of how to use this with files is a bit confusing to me. I
learned to program 15 years ago and never learned visual anything.

In any case can someone show me how to write a loop that performs a task on
every file on a floppy drive? All files would be in the root directory if
that helps.

Thanks for any help.


Jake Marx[_3_]

Loop through all files on a floppy drive
 
Please see response to previous post.

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]


ED007 wrote:
I posted the question below in the general threads but thought it
might be better placed here.

I have some equipment that periodicaly records some data to disk.
Unfortunatly each time it records the data it creates a new file and
records a great deal of extranious data. I use sneaker net to
transfer the files to my PC. I can open each file (theyare text),
and have written a macro to extract the data needed and place it in
an excel sheet in order. However, I must open each file change its
name to the name used in the macro and run the macro. This is
almost as big a pain as printing each file and copying the data by
hand.

I see that there is a For Each ... Next structure in visual basic,
but the only example of how to use this with files is a bit
confusing to me. I learned to program 15 years ago and never
learned visual anything.

In any case can someone show me how to write a loop that performs a
task on every file on a floppy drive? All files would be in the
root directory if that helps.

Thanks for any help.


PY & Associates

Loop through all files on a floppy drive
 
Can you try

use getopenfilename (...(*.txt), *.txt) to display all files available
rewrite your macro to take filename so selected
loop next file
--
Regards
PY & Associates

"ED007" wrote in message
...
I posted the question below in the general threads but thought it might be
better placed here.

I have some equipment that periodicaly records some data to disk.
Unfortunatly each time it records the data it creates a new file and

records
a great deal of extranious data. I use sneaker net to transfer the

files to
my PC. I can open each file (theyare text), and have written a macro to
extract the data needed and place it in an excel sheet in order.

However, I
must open each file change its name to the name used in the macro and

run the
macro. This is almost as big a pain as printing each file and copying

the
data by hand.

I see that there is a For Each ... Next structure in visual basic, but

the
only example of how to use this with files is a bit confusing to me. I
learned to program 15 years ago and never learned visual anything.

In any case can someone show me how to write a loop that performs a task

on
every file on a floppy drive? All files would be in the root directory

if
that helps.

Thanks for any help.





All times are GMT +1. The time now is 05:09 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com