Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default Macro Print to file limited the no of character in a row?

I'm trying to output the contents of the cells in Excel to a txt file with
the Print # method. But the result is the output is divided into 3 lines. I
wonder if there is a limit of the no. of character allowed in the txt file
when using Print # method. The following is my code:

Print #FNum, vIER; Tab(7); vLPAR; Tab(17); vCHL; Tab(37); vMQM; Tab(49);
vTYP; Tab(57); vEXT; Tab(58); vOCL; Tab(1058); vOSC; Tab(2058); vEDATE;
Tab(2088); vTDATE; Tab(2118); vHDATE; Tab(2148); vJDATE; Tab(2178); vSTAT

Is there any way to print all the contents in a single row? I know it's a
bit too long (more than 2000 chars), but I have to upload the txt file into
the AS/400 Database file which I have to get all the data align with the
predefined format of the table.

Thanks in advance!!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Macro Print to file limited the no of character in a row?

Take a look at VBA's help for Tab. You'll see that it uses the "Width #"
statement. Since Width is limited to 255, I think you should just drop Tab()
and use Space().

Print #FNum, vIER; space(7); vLPAR; space(17);.......

Leslie wrote:

I'm trying to output the contents of the cells in Excel to a txt file with
the Print # method. But the result is the output is divided into 3 lines. I
wonder if there is a limit of the no. of character allowed in the txt file
when using Print # method. The following is my code:

Print #FNum, vIER; Tab(7); vLPAR; Tab(17); vCHL; Tab(37); vMQM; Tab(49);
vTYP; Tab(57); vEXT; Tab(58); vOCL; Tab(1058); vOSC; Tab(2058); vEDATE;
Tab(2088); vTDATE; Tab(2118); vHDATE; Tab(2148); vJDATE; Tab(2178); vSTAT

Is there any way to print all the contents in a single row? I know it's a
bit too long (more than 2000 chars), but I have to upload the txt file into
the AS/400 Database file which I have to get all the data align with the
predefined format of the table.

Thanks in advance!!


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Linked cells limited to ~253 characters unless source file open ScottFisher2004 Excel Worksheet Functions 3 June 24th 08 03:40 PM
Limited character display Steve_zsli Excel Discussion (Misc queries) 5 August 8th 07 03:35 PM
Limited Print Area nitsa Excel Discussion (Misc queries) 1 July 5th 06 04:34 PM
importing undelimited text file data, character-by-character The Mos$ Excel Programming 4 December 26th 05 11:01 AM
How to convert De-limited text file to excel Venkatesh S Charts and Charting in Excel 3 May 3rd 05 01:28 AM


All times are GMT +1. The time now is 04:50 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"