ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   CSV Import - user to select file (https://www.excelbanter.com/excel-programming/379332-csv-import-user-select-file.html)

joecrabtree

CSV Import - user to select file
 
To all,

I have recorded a macro that imports a csv file into my worksheet.
However the file selected is 'hard coded' into the macro. Is there any
way that I can get this to change depending on which file the user
wants to select to open.

Thanks

Joseph Crabtree


Jason Lepack

CSV Import - user to select file
 
sInputFile = Application.GetOpenFilename("Text files, *.txt", , "Select
your text file", , False)
If sInputFile = "False" Then
MsgBox "Import cancelled at user request."
Exit Sub
End If

joecrabtree wrote:
To all,

I have recorded a macro that imports a csv file into my worksheet.
However the file selected is 'hard coded' into the macro. Is there any
way that I can get this to change depending on which file the user
wants to select to open.

Thanks

Joseph Crabtree




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

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