ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Using Message Box to Open/Import Text File (https://www.excelbanter.com/excel-programming/282871-using-message-box-open-import-text-file.html)

hjones

Using Message Box to Open/Import Text File
 
Hello

I was wondering if it is possible to Import multiple text
files to different sheets within a workbook. I would
like to do this by having a box (I think it's called a
messge box) open asking for the user to type in the file
name. Each file will be from the same path, so could
that could be set as default path? Is this possible?

Thanks for the help.

Tom Ogilvy

Using Message Box to Open/Import Text File
 
Use

Chdrive "C"
Chdir "C:\my textfiles"
arrFnames = Application.GetOpenfileName( _
filefilter:= "Text Files (*.txt),*.txt", multiSelect:=True)

see help for details.

--
Regards,
Tom Ogilvy

"hjones" wrote in message
...
Hello

I was wondering if it is possible to Import multiple text
files to different sheets within a workbook. I would
like to do this by having a box (I think it's called a
messge box) open asking for the user to type in the file
name. Each file will be from the same path, so could
that could be set as default path? Is this possible?

Thanks for the help.





All times are GMT +1. The time now is 05:22 PM.

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