ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   import text file (https://www.excelbanter.com/excel-programming/342953-import-text-file.html)

Lynn[_7_]

import text file
 
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 ?


Tom Ogilvy

import text file
 
To open a text file:

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

--
Regards,
Tom Ogilvy

"Lynn" wrote in message
oups.com...
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 ?





All times are GMT +1. The time now is 04:44 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com