index > Visual Basic for Applications (VBA) > Converting text file to excel file macro - help needed

Converting text file to excel file macro - help needed


I have a text file I need to convert to an excel spreadsheet. I wouldn't have a problem making an array code if it were a straight file but the trick is that each line could be different.

For example:

Line one is

01330948951000312 eeid jan boerenkamp

line 2 is

023330948951000312 00370058274800350010112/01/2002

Line 3 is

05330948951000312 31065327123107533811

any time a line begins with 01 it will follow that format

any time a line begins with 02 it will follow the format of line 2 and so on

Is there a way to make an array to put into Excel so that if a line starts with 01 it splits it one way and if a line begins with 02 it splits another way and so on?

Thanks in advance

Mary Lindholm
You could try the Text Import Wizard:
Navajo
reply 2

You can use google to search for other answers

 

More Articles

• ADO Connection in Ms Access
• Access Doesn't Close after ActiveX is inserted
• Excel macro question - ref: sheets (hopefully a simple one!)
• Using a single variable to get a combined worksheet and range - i...
• Size Form to fit user resolution
• Word: Normal.dot template menu bar
• Using the API of Visio to open a Custom Method in Visio
• Can anybody explain this code for me ???
• VBA within Excel_revised
• How to change the DisplayAlert Response?
Welcome to Bokebb   New Update   Joins the collection  
 

New Articles

• Put E-mail In From Field
• Possible to add multiple (300+) hyperlin
• Undo Command(EXCEL)
• Hyper link Macro
• Word Thesaurus and Dictionary
• start Access Query Designer/Builder from
• How to create a hyperlink in Excel Chart.
• additem issue with populating a combobox
• How to execute MS Query inside Excel VBA?
• unable to register comsvcs.dll
• access vba issues
• Bound form
• Compiling Excel VBA-code?
• jump to other slides of a ppt by selecti
• Contacts who Customize MapPoint

Hot Articles

• Using the API of Visio to open a Custom
• Generate XML from Excel Data
• showing userforms in html format
• Help with largest values and counts of t
• Excel disjunction
• Export excel sheet as text file with mac
• Reading data dll into excel
• Run-time error '1004' in import macro
• Linking Outlook to Excel
• email from excel
• Map XML elements with VBA
• am i have mak mistake?
• Application Hosted Scripting IDE in .NET
• Macro on Sheet Tab Very Slow
• Worksheet_Change Error

Recommend Articles

• About Jet WorkSpace
• VB and Excel - Change Event
• create command button that holds a proce
• Trying to create a global variable
• S.O.S Sending Escape Sequence to printer
• Creating AD user with profile & home
• ReadAll reading in first 254 characters
• MS Access key problem
• Visio Zoom
• On Error not catching problem with a web
• command button issue
• Modify .PRJ File
• Copying selected Worksheets to new workb
• Access and TransferText
• Setting the Directory at GetOpenFileName