Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8
Default Can I save "Data Text to columns" definitions

I have to convert text to columns and have to repeat the process every time
the data changes. The file definitions are constant and wondered if there was
any way that I could save the definitions and merely re-run the text to
column function based on new data using an existing definition.

EG
01000123000164

Use Data Text to columns to get
01 000123 000164 columns of data

The column break is constant ie column 1 = positions 1&2, column 2 =
positions 3-8 and column 3 = positions 9 -14. This I would like to save so I
could just re-apply this definition to new data. At the moment I have to keep
re-iterating the column break points for each new data set (often a record
set is quite big 100 characters).

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 698
Default Can I save "Data Text to columns" definitions

Select your data and try using the macro recorder on an example of your
data. It will look something like this.

Sub Macro1()
Selection.TextToColumns Destination:=Range("A8"), _
DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(2, 1), Array(8, 1)), _
TrailingMinusNumbers:=True
End Sub

Now select your data and run the macro.

HTH
Regards,
Howard

"marg" wrote in message
...
I have to convert text to columns and have to repeat the process every time
the data changes. The file definitions are constant and wondered if there
was
any way that I could save the definitions and merely re-run the text to
column function based on new data using an existing definition.

EG
01000123000164

Use Data Text to columns to get
01 000123 000164 columns of data

The column break is constant ie column 1 = positions 1&2, column 2 =
positions 3-8 and column 3 = positions 9 -14. This I would like to save so
I
could just re-apply this definition to new data. At the moment I have to
keep
re-iterating the column break points for each new data set (often a record
set is quite big 100 characters).



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
Selecting "Save As" adds "Copy of" to file name- MS Excel 2007 ronhansen Excel Discussion (Misc queries) 1 November 15th 09 09:33 PM
CSV file doesn't save "xEy" style number as text formatted data [email protected] Excel Discussion (Misc queries) 1 July 30th 08 06:03 PM
"CELL("FILENAME") NOT UPDATE AFTER "SAVE AS" ACTION yossie6 Excel Discussion (Misc queries) 1 June 16th 08 12:16 PM
"Save" and "Save As" options greyed out - "Save as Webpage" option Bill Excel Discussion (Misc queries) 0 January 16th 07 04:47 PM
Insert "-" in text "1234567890" to have a output like this"123-456-7890" Alwyn Excel Discussion (Misc queries) 3 October 25th 05 11:36 PM


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