write out formatted text files

E

embirath

Hi everyone

I want to write a procedure in VBA which reads information input by th
user into an Excel worksheet, then manipulate the data, and then finall
write out text files which have my own specified format. In other words
I do not want to write out csv files, or tab delimited files. Instead
want to define the format of the text files myself inside the VB
procedure. Does anyone know how I can do this?

I guess one way of doing this would be to read in the data, manipulat
it, and then create a new worksheet where all my formatted text is i
the first column. Thus when I write out the text file, it won't put an
commas or tabs where I don't want them. But this method seems a bi
tedious, so I'm wondering if you have any other ideas that would mak
the job easier.

Thank you!
E
 
N

NickHK

If you really want to invent your own file format to store formatting info,
you will need to read/write it to file yourself using the Open statement.
It would probably be better to write a class to do this.

However, there are a number a format available that would save you the
trouble of creating you own; Rich Text Format, HTML, Word.
Depends what you are trying to achieve.

NickHK
 
E

embirath

Thanks Nick! I will check out the Open statement and see if it can d
what I want.

The files I'm writing out have to be read in by another piece o
software which only reads on particular unique format. So I'm stuc
with creating my own format, unfortunately.

Thanks for your input.
Emm
 
N

NickHK

Have a look at this http://vb-helper.com/tut5.htm for serialising object.
So you can pass a Range/Characters/TextBox object and your classes reads the
text along with the various formatting info and writes it to a file in the
required format.

NickHK
 

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