import text file

  • Thread starter Thread starter Lynn
  • Start date Start date
L

Lynn

hi,
i have a macro as follows

ChDrive "c"
ChDir "c:\Mydata"
fileToOpen = Application.GetOpenFilename(filefilter:="Text Files
(*.txt),*.txt")

how can i use the above to import a text file ?
 
To open a text file:

ChDrive "c"
ChDir "c:\Mydata"
fileToOpen = Application.GetOpenFilename(filefilter:="Text Files
(*.txt),*.txt")
Workbooks.Open FiletoOpen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top