Importing txt file

Kizzz

New Member
Joined
Jan 19, 2005
Messages
4
Hello -

I'm trying to write code that will import a text file into a workbook without having the user go through the import wizard. I know that the text file will be two columns delimited with an equal ('=') sign. What I can't control is the name or location of the file. I'd like to allow the user to browse to the location of the file, select the file, and then have the macro do the rest.

Any help is appreciated.
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Try using the GetOpenFilename method.
 
Upvote 0
Looks like Norie's got you all sorted out. But should you want to learn more, you might take a look at the FileDialog object too and play with that when you have a spare moment. It's a little more configurable than the GetOpenFilename function (not that there's anything wrong with GOF(), mind you, just another tool in the box).
 
Upvote 0

Forum statistics

Threads
1,203,600
Messages
6,056,206
Members
444,850
Latest member
dancasta7

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