Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default xlTextFormat in TextToColumns

I am parsing fixed width data with the following code:

Range("a1", ActiveCell.SpecialCells(xlLastCell)).Select
Selection.TextToColumns Destination:=Range("A1"),
DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(8, 1), Array(11, 9), Array(12, 1))

The data in the last array is numeric. I need it to be brought in as text
so as not to loose the leading zeros. How do I apply xlTextFormat?

Thanks in advance!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default xlTextFormat in TextToColumns

Array(12, 1)
becomes
Array(12, xlTextFormat)
or
Array(12, 2)

Sometimes, it's quicker to record a macro when you do this manually and look at
the code.


CinqueTerra wrote:

I am parsing fixed width data with the following code:

Range("a1", ActiveCell.SpecialCells(xlLastCell)).Select
Selection.TextToColumns Destination:=Range("A1"),
DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(8, 1), Array(11, 9), Array(12, 1))

The data in the last array is numeric. I need it to be brought in as text
so as not to loose the leading zeros. How do I apply xlTextFormat?

Thanks in advance!


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default xlTextFormat in TextToColumns

Awesome - Thanks!


"Dave Peterson" wrote:

Array(12, 1)
becomes
Array(12, xlTextFormat)
or
Array(12, 2)

Sometimes, it's quicker to record a macro when you do this manually and look at
the code.


CinqueTerra wrote:

I am parsing fixed width data with the following code:

Range("a1", ActiveCell.SpecialCells(xlLastCell)).Select
Selection.TextToColumns Destination:=Range("A1"),
DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(8, 1), Array(11, 9), Array(12, 1))

The data in the last array is numeric. I need it to be brought in as text
so as not to loose the leading zeros. How do I apply xlTextFormat?

Thanks in advance!


--

Dave Peterson

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
sub TextToColumns Gabriel[_3_] Excel Programming 1 October 21st 04 04:34 PM
Q TextToColumns Simon Woods[_3_] Excel Programming 1 May 21st 04 12:29 PM
texttocolumns Doug Broad[_4_] Excel Programming 4 April 21st 04 02:50 AM
TextToColumns Randy Reese Excel Programming 2 February 24th 04 07:44 PM
TextToColumns Dialog Howie[_3_] Excel Programming 1 October 28th 03 09:22 PM


All times are GMT +1. The time now is 04:14 AM.

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

About Us

"It's about Microsoft Excel"