LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Cells to Columns in Text File

I cannot simply save the file to PRN because I do not want to send
everything. I already wrote a loop that picks up the precise data and
writes to a line in the file.

This is basically what I have come up with (with some help from other
groups!):


For L = 5 To daLastRow
'Lot of mess but writes to correct positions
numberToFormat = Cells(L, 26)
sNumber = Format(numberToFormat, "#.00")
B1 = Space(17 - Len(sNumber)) & sNumber
numberToFormat = Cells(L, 29)
sNumber = Format(numberToFormat, "#.00")
b2 = Space(17 - Len(sNumber)) & sNumber
numberToFormat = Cells(L, 32)
sNumber = Format(numberToFormat, "#.00")

Print #1, Tab(5); Left(Cells(2, 1), 6); Tab(14); tsCol; _
B1; b2; B3; B4; B5; B6; B7; B8; B9; B10; B11; B12
Next L



Just hoping that there was an automatic way to line up in a position
without the calisthenics.



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/



 
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
open text file in Excel and remove columns SLP Excel Discussion (Misc queries) 5 August 14th 08 04:37 PM
How do I prevent a text to columns while opening a csv file in Excel Michiel via OfficeKB.com Excel Discussion (Misc queries) 3 July 28th 08 01:30 PM
How do I save excel file in text format without columns? Tuuti Excel Discussion (Misc queries) 1 July 15th 08 06:40 PM
Can I take a huge irregular text file and place it into columns? PerplexedinKY Excel Discussion (Misc queries) 2 January 12th 07 03:12 PM
.csv file Text to Columns Duane L Kibby Excel Worksheet Functions 1 April 29th 05 12:29 AM


All times are GMT +1. The time now is 06:53 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"