Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Saved from a previous post:
You could concatenate the cell values into another column: =LEFT(A1&REPT(" ",5),5) & LEFT(B1&REPT(" ",4),4) & TEXT(C1,"000,000.00") (You'll have to modify it to match what you want.) Drag it down the column to get all that fixed width stuff. Then I'd copy and paste to notepad and save from there. Once I figured out that ugly formula, I kept it and just unhide that column when I wanted to export the data. If that doesn't work for you, maybe you could do it with a macro. Here's a link that provides a macro: http://google.com/groups?threadm=015...0a% 40phx.gbl Rushna wrote: Hello All, I am using Excel 2003 and have data in Range D10:Q(20,000+ rows). I wish to export the all active rows in the range in the Excel file to a text file (Notepad). Details are as follow: Col C (currently 4 digits) – to be exported (total 9 digits) with trailing blanks (eg. 1234 – should export as 1234(blank)(blank)(blank) (blank)(blank) Col F (currently 8 digits) – to be exported (total 10 digits) with two leading blanks (eg 12345678 should show as 0012345678) Col H (currently 21.02.2008 – to be exported as yyyymmdd (eg 20080221) Col I (currently 21.02.2008 – to be exported as yyyymmdd (eg 20080221) Col K (currently -43,413.20) – to be exported as total 15 digits with leading zeros, 2 decimal place, no decimal signs (eg -43,413.20 should display as 000000004341320 and -1,234.23 should display as 000000000123423 etc) Col L – to be exported with two trailing blanks (currently EUR – should display as EUR(blank)(blank). Col Q – to be exported as ten digits (eg. AABBCCDDXXX). If the cell is blank nothing should be exported The output on each line in the text file should be a total width of 66 (including spaces) from various Columns in Excel as explained above and displayed as follows: 1234(blank)(blank)(blank)(blank) (blank)00123456782008022120080221000000004341320EU R(blank) (blank)AABBCCDDXXX (this counts to 66 including blank spaces) Thanks in advance. Rushna -- Dave Peterson |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I export data in text format with minimum of spaces? | Excel Discussion (Misc queries) | |||
How to make text data export to excel in text format. | Excel Programming | |||
Open CSV file, format data and write output to a text file. | Excel Programming | |||
How do I import text file, analyze data, export results, open next file | Excel Programming | |||
Convert data and export to a text file | Excel Programming |