Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
johnfli
 
Posts: n/a
Default Exporting to a txt file in a certain format.

I have an excel sheet that I need to export into a certain format.
I will need to have it so each column will only export the first (x) amount
of characters in each cell, then add a SPACE, then add the first (x) amount
of characters from teh next cell.

How do I do that?


  #2   Report Post  
Dave O
 
Posts: n/a
Default

Hi, John-
Suppose your existing data is in a tab called Sheet1; cell A1 contains
the text string ABCDE; cell B1 contains a number 12345.

Insert a new tab in the workbook- for purposes of this example I used
the default name Sheet2. In cell Sheet2!A1 enter this formula:
=MID(Sheet1!A1,1,3)&" "&MID(Sheet1!B1,1,3)
The result in Sheet2!A1 is "ABC 123".

The MID function returns a portion of a string function that you
indicate: in this example, it starts in Sheet1!A1 in column 1 and
returns the first 3 columns. The ampersand in the middle is a
concatenator that joins the results of different functions.
Can you modify this example to fit your application?

  #3   Report Post  
Dave O
 
Posts: n/a
Default

Forgot to mention: you can then export Sheet2 in the .TXT format of
your choice.

  #4   Report Post  
johnfli
 
Posts: n/a
Default

Yeah, I might be able to use that. Thanks.
After testing it, I'll convert it into a macro.

Thanks again!


"Dave O" wrote in message
ups.com...
Hi, John-
Suppose your existing data is in a tab called Sheet1; cell A1 contains
the text string ABCDE; cell B1 contains a number 12345.

Insert a new tab in the workbook- for purposes of this example I used
the default name Sheet2. In cell Sheet2!A1 enter this formula:
=MID(Sheet1!A1,1,3)&" "&MID(Sheet1!B1,1,3)
The result in Sheet2!A1 is "ABC 123".

The MID function returns a portion of a string function that you
indicate: in this example, it starts in Sheet1!A1 in column 1 and
returns the first 3 columns. The ampersand in the middle is a
concatenator that joins the results of different functions.
Can you modify this example to fit your application?



  #5   Report Post  
Harald Staff
 
Posts: n/a
Default

Not very easy. See if this gets you started:
http://www.erlandsendata.no/english/...extexportfixed

HTH. Best wishes Harald

"johnfli" skrev i melding
...
I have an excel sheet that I need to export into a certain format.
I will need to have it so each column will only export the first (x)

amount
of characters in each cell, then add a SPACE, then add the first (x)

amount
of characters from teh next cell.

How do I do that?






  #6   Report Post  
Earl Kiosterud
 
Posts: n/a
Default

John,

Here's a solution similar to that of Dave O.

In a separate mirror sheet, in A1:

=LEFT(Sheet1!A1, x)

Copy this sufficiently down and across using the Fill Handle. Now write
this sheet using the Text Write Program (a free Excel workbook) at
www.smokeylake.com/excel. Set the field delimiter to a space.

--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"johnfli" wrote in message
...
I have an excel sheet that I need to export into a certain format.
I will need to have it so each column will only export the first (x)
amount
of characters in each cell, then add a SPACE, then add the first (x)
amount
of characters from teh next cell.

How do I do that?




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
exporting a chart to gif format using COM (Excel v11 and .net) Katie Charts and Charting in Excel 2 December 31st 04 06:04 AM
File asks to update when no links were created Dave Links and Linking in Excel 1 December 16th 04 08:10 PM
Using Jet to read excel file returns blank for last cell - sometim Ron Excel Discussion (Misc queries) 1 December 9th 04 08:21 AM
format question when open csv file Jeff Excel Discussion (Misc queries) 1 December 1st 04 06:53 PM
Convert text file to MS_Excel Aqua Flow Excel Discussion (Misc queries) 1 November 30th 04 02:55 AM


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