ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   write out formatted text files (https://www.excelbanter.com/excel-programming/369654-write-out-formatted-text-files.html)

embirath

write out formatted text files
 

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

--
embirat
-----------------------------------------------------------------------
embirath's Profile: http://www.excelforum.com/member.php...fo&userid=3720
View this thread: http://www.excelforum.com/showthread.php?threadid=56917


NickHK

write out formatted text files
 
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

"embirath" wrote in
message ...

Hi everyone

I want to write a procedure in VBA which reads information input by the
user into an Excel worksheet, then manipulate the data, and then finally
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 I
want to define the format of the text files myself inside the VBA
procedure. Does anyone know how I can do this?

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

Thank you!
Em


--
embirath
------------------------------------------------------------------------
embirath's Profile:

http://www.excelforum.com/member.php...o&userid=37202
View this thread: http://www.excelforum.com/showthread...hreadid=569171




embirath[_2_]

write out formatted text files
 

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

--
embirat
-----------------------------------------------------------------------
embirath's Profile: http://www.excelforum.com/member.php...fo&userid=3720
View this thread: http://www.excelforum.com/showthread.php?threadid=56917


NickHK

write out formatted text files
 
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

"embirath" wrote in
message ...

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

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

Thanks for your input.
Emma


--
embirath
------------------------------------------------------------------------
embirath's Profile:

http://www.excelforum.com/member.php...o&userid=37202
View this thread: http://www.excelforum.com/showthread...hreadid=569171





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

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