Help: Converting text to xls format with a macro

  • Thread starter Peter de B. Harrington
  • Start date
P

Peter de B. Harrington

Hi All:

There is a certain company that I won't mention out of politeness that
stores data files with an xls extension but the files are actually text
files. I have to work with hundreds of these files and right now I must
manually convert them from text format to xls format. I would appreciate a
faster method than opening each file, using the saveas commmand and then
selecting xls format form in the dialog. I tried recording a macro while
going through the above steps, while recording the macro saves the file
correctly, but when I use the recorded macro on a new file it is saved over
the file that I used to record the macro. It seems that there must be a way
to write a macro that works correctly, but the help has been somewhat
helpless.

TIA,

Pete
 
J

Jim Cone

Pete,
The TextFilesToWorksheets_R2 code in the bottom portion of this post
(with some changes) could do what you want.
http://snipurl.com/yhv6
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"Peter de B. Harrington"
<[email protected]>
wrote in message
Hi All:
There is a certain company that I won't mention out of politeness that
stores data files with an xls extension but the files are actually text
files. I have to work with hundreds of these files and right now I must
manually convert them from text format to xls format. I would appreciate a
faster method than opening each file, using the saveas commmand and then
selecting xls format form in the dialog. I tried recording a macro while
going through the above steps, while recording the macro saves the file
correctly, but when I use the recorded macro on a new file it is saved over
the file that I used to record the macro. It seems that there must be a way
to write a macro that works correctly, but the help has been somewhat
helpless.
TIA,
Pete
 

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