Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text To Columns

Status
Not open for further replies.

TheComputerDude

Programmer
Feb 27, 2006
14
0
0
US
I need to dynamically convert parts of a spreadsheet to columns. I used a macro to get the following syntax:

Selection.TextToColumns Destination:=Range("A7"), DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(11, 1), Array(24, 1), Array(37, 1), Array(50, 1), _
Array(63, 1), Array(76, 1), Array(89, 1), Array(102, 1), Array(115, 1)), _
TrailingMinusNumbers:=True

My question is how can I dynamically change the field info section? Any help would be greatly appreciated!
 
The array dimension and/or size may change due to the data being displayed. I would like to be able to dynamically change the number and/or size of the fields.
 





You build a 2 dimensional array and then assign it to FieldInfo.

Skip,
[sub]
[glasses] [red][/red]
[tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top