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

Below is part of a macro which splits a fixed width file into the required
columns, ColSplit being the variable for the split positions. When this is
imported into Excel how can I make all the fields be Text formatted as it is
formatting the columns as General at the moment and leading zeros are being
dropped.

Many thanks

Selection.TextToColumns Destination:=Range("A1"), DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(ColSplit(1), 1),
Array(ColSplit(2), 1), Array(ColSplit(3), 1), Array(ColSplit(4), 1), _
Array(ColSplit(5), 1), Array(ColSplit(6), 1), Array(ColSplit(7), 1),
Array(ColSplit(8), 1), Array(ColSplit(9), 1), Array(ColSplit(10), 1), _
Array(ColSplit(11), 1), Array(ColSplit(12), 1))


 
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
TextToColumn when destination to other sheet CG Rosen Excel Discussion (Misc queries) 4 November 17th 09 09:10 PM
Split up dk New Users to Excel 5 December 16th 08 09:05 PM
How do I remove split a split window? Norm New Users to Excel 3 July 19th 08 10:31 PM
Un-Split Justme-in-Az Excel Discussion (Misc queries) 4 December 30th 06 07:49 PM
Split a Value Gabe Excel Discussion (Misc queries) 4 December 20th 05 05:28 PM


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