Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Save as FIXED LENGTH

Is it possible to define the length of a field in excel
then save it as a FIXED LENGTH formatted text file?
eg. --Currently happening--
Hello,Black,Apple,Computer
--What i want to happen--
Hello ,Black ,Apple ,Computer
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Save as FIXED LENGTH

Anthony,

Sub test()
Const cFileName = "C:\T\myfile.txt"
Dim intFreeFile As Integer
Dim strVar1 As String, strVar2 As String
Dim strVar3 As String, strVar4 As String

strVar1 = "Hello": strVar2 = "Black"
strVar3 = "Apple": strVar4 = "Computer"

intFreeFile = FreeFile
Open cFileName For Output As #intFreeFile
Print #intFreeFile, strVar1; Tab(9); ","; strVar2; Tab(16); ",";
strVar3; Tab(28); ","; strVar4
Close #intFreeFile
End Sub

Rob


"Anthony" wrote in message
...
Is it possible to define the length of a field in excel
then save it as a FIXED LENGTH formatted text file?
eg. --Currently happening--
Hello,Black,Apple,Computer
--What i want to happen--
Hello ,Black ,Apple ,Computer



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
I'd like to have the X-axis a fixed length. Ake Charts and Charting in Excel 0 September 25th 08 05:42 PM
Fixed Length, Text Formatted Novice2000 Excel Discussion (Misc queries) 2 May 13th 08 06:06 PM
fixed length file Steve S[_2_] Excel Discussion (Misc queries) 2 March 13th 07 04:12 PM
save an excel file in fixed length records whose fields are blank ascii save Excel Discussion (Misc queries) 1 October 13th 05 06:01 PM
Save data in a worksheet in fixed length fields... dietzd Excel Discussion (Misc queries) 1 January 26th 05 06:17 PM


All times are GMT +1. The time now is 02:03 PM.

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

About Us

"It's about Microsoft Excel"