ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   output data from excel into text file using vba (https://www.excelbanter.com/excel-programming/364540-output-data-excel-into-text-file-using-vba.html)

pier59

output data from excel into text file using vba
 
Is there a way to out put data from Excel into Text with column
oriented data format using VBA? For example, i have 50 rows and 8
columns and i need to write data in cell A to write at the 1st position
in the text file. Data from cell B to write at the 16th position in the
text file, etc. I know that we can set this up from Access db by
recordset, but how do we do this in VBA or VB?

Thank you for any help.


Tom Ogilvy

output data from excel into text file using vba
 
Do you mean column A, then column B, rather than cell A and Cell B

You should be able to adapt this code from Chip Pearson's site to do that:

http://www.cpearson.com/excel/imptext.htm import/export text files

--
Regards,
Tom Ogilvy


"pier59" wrote:

Is there a way to out put data from Excel into Text with column
oriented data format using VBA? For example, i have 50 rows and 8
columns and i need to write data in cell A to write at the 1st position
in the text file. Data from cell B to write at the 16th position in the
text file, etc. I know that we can set this up from Access db by
recordset, but how do we do this in VBA or VB?

Thank you for any help.



pier59

output data from excel into text file using vba
 
Tom,
Thanks for trying to help.
Yes, column A, then column B, rather than cell A and Cell B. For
example if i want the data to be write at the position 91st in the text
file, i need to set this data from excel where cell CM is?
thanks again.
Melvin

Tom Ogilvy wrote:
Do you mean column A, then column B, rather than cell A and Cell B

You should be able to adapt this code from Chip Pearson's site to do that:

http://www.cpearson.com/excel/imptext.htm import/export text files

--
Regards,
Tom Ogilvy


"pier59" wrote:

Is there a way to out put data from Excel into Text with column
oriented data format using VBA? For example, i have 50 rows and 8
columns and i need to write data in cell A to write at the 1st position
in the text file. Data from cell B to write at the 16th position in the
text file, etc. I know that we can set this up from Access db by
recordset, but how do we do this in VBA or VB?

Thank you for any help.





All times are GMT +1. The time now is 01:22 PM.

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