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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text File information break out to Excel - Using Macro

Status
Not open for further replies.

useractive

Programmer
Jun 21, 2001
98
US
I have a text file that has the exact same formatting all the way across it, looks something similar to this:

Billto Code Client Code Client Name......... Inv. No... Dept Policy Number.. Inv.Date
AMERLEGI1 AMERLEGI1 157674 8161 CP00138523 05\30\03

When you paste this into excel, it goes through and puts everything in column 1. Doesnt' help me much, what i want to do is find out if there is a way to create a macro that will look at the information in excel in column one and go through and break it out so that everytime there is a space in the row, it puts that information into a different column? Any ideas on this one? Thanks, Swish
 
Useractive:
Once in Excel and pasted in one column use the Text To Columns wizard to break your data into seperate colomns.

Highligth column 1 then click on Data --> Text to Columns and follow the instrunctions ont he screen. Choose either fixed length or Delimited.

Or do a File --> Open --> select your Text file --> Click Open. This automatically brings up Text to columns wizard .

I hope this helps.

mosmas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top