ASCII files ...please help

R

riggi

Hello
I was wondering is it possible to save a cell value in a txt file and
plus specify which row and column you want to put that value in that
text file??


PS: I know how to save the worksheet as a text file.


Thanks
 
C

Chip Pearson

It depends on how you want your data in the text file formatted.
A simple way is

Open "H:\Test.txt" For Output As #1
Print #1, Range("A1").Value, Range("A1").Address
Close #1


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
R

riggi

Yes sir, this is a simple way of doing it. But, what if I want to
specify that copy Range("A1").Value to for instance 7th row and 9th
column in that text file. Is it possible??

thanks, I really appreciate.


Riggi
 
D

Dave Peterson

R

riggi

Thanks. appreciate it!


Riggi



Dave said:
You want to have more control on how you write the values to a text file??

Some sample code to get you started:

Earl Kiosterud's Text Write program:
www.smokeylake.com/excel
(or directly: http://www.smokeylake.com/excel/text_write_program.htm)

Chip Pearson's:
http://www.cpearson.com/excel/imptext.htm

J.E. McGimpsey's:
http://www.mcgimpsey.com/excel/textfiles.html

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
 
Top