CSV Import - user to select file

J

joecrabtree

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
 
J

Jason Lepack

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
 

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

Top