Excel Text File Import Macro

nzepeda

Board Regular
Joined
Nov 11, 2010
Messages
58
I would like to make a macro that imports a text file into Excel. This I have done before and is easy enough. The tough part is that the file I am using has a header that gets jumbled up when I setup the columns for the data. Is there a way to have the import column out the header, so that it is readable and then handle the data delimited?I am trying to make a database from the file, the header has information that is important for being able to separate the different days.
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
I would like to make a macro that imports a text file into Excel. This I have done before and is easy enough. The tough part is that the file I am using has a header that gets jumbled up when I setup the columns for the data. Is there a way to have the import column out the header, so that it is readable and then handle the data delimited?I am trying to make a database from the file, the header has information that is important for being able to separate the different days.


…? It is not too clear wot you want. As you say ….
… I have done before and is easy enough. ….
…….
There are lots of MrExcel Threads,
Here for example http://www.mrexcel.com/forum/excel-...ll-one-cell-need-comma-delimit-instead-4.html different methods were discussed and coincidentally some methods did different things to the Headers. There might therefore be some Tips there.



. In any case if you need some specific help it would be useful for anyone viewing if you try to show clearly what you have in your Text file and how you want the final results to look like in an excel spreadsheet
. So it would be to your advantage if you can you provide a clear Table or tables showing some text file example data but also importantly exactly how the final output should look like in the Excel File based on your actual example data…….

(. You have been at it longer than me so you may know this. Sorry if I am trying to teach my Nan to suck eggs (or whatever the saying goes)………)

…….But. .. There are various ways to do this. The first is preferred by this Forum for excel files as then everyone can see wot is going on quickly. (But It is an excel Add-in so it does not help for a text File). The Third method I prefer. - Then one can get on straight away with writing a code for you in the file you provide.

. 1 If you can, try uploading this, https://onedrive.live.com/?cid=8cffd...CE27E813%21189 instructions here MrExcel HTML Maker . This free Excel add-In is good for screen shots here of spreadsheets. Then everyone can quickly see what is going on and follow the Thread easily.
Or
. 2 Up left in the Thread editor is a table icon. Click that, create an appropriately sized table and fill it in. (To get this icon up in the Reply window you may need to click on the “Go Advanced” Button next to the Reply Button)
Or
. 3 supply us with an example text file (Can of course be shortened, or Made up data in case any info is sensitive) and an excel file that looks like the final result using the method you currently use.
. For example send over this free thing Box Net,
Remember to select Share after uploading and give us the link they provide.
 
Upvote 0

Forum statistics

Threads
1,214,661
Messages
6,120,790
Members
448,994
Latest member
rohitsomani

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top