Save as a new format name automatically

T

Tom

Hi,

I am using a macro that enables me to open text files one
after another automatically. Each file contains many rows
of comma delimited data like,

ABC,20100611,2.76,2.79,2.7,2.72,1704614
-------------------------------------------------
-------------------------------------------------
XYZ,20100611,4.9,4.36,4.79,4.22,3418135

The files themselves are named after its content date like
20200611.txt. The macro then extracts some wanted data to
another file, closes down, opens the next file 20100612.txt and
repeats the process. Before it closes, how can I modify the macro
to make it save each one of them with a new format name, like
20100612.csv? - i.e. the save as command needs to use the first part
of the name of the file that is currently open. Thanks for any help.

TIA
Tom
 
D

Don Guillett Excel MVP

As ALWAYS, post your code for comments. Look in the vba help index
for SAVEAS
 
T

Tom

As ALWAYS, post your code for comments. Look in the vba help index
for  SAVEAS




- Show quoted text -

What came before is irrelevant. The macro must be able to:
1. Read the the "activefile name".
2. Save it with a .csv format.

Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top