Forum Discussion
Import CSV from listbox in userform
Enclosed in your file is a different approach, is simpler and can easily be used again and again.
Button: Nikolinos Proposal Import CSV File
I would be happy to know if I could help.
I wish you continued success with Excel
Nikolino
I know I don't know anything (Socrates)
* Kindly Mark and Vote any reply if it helps please, as it will be beneficial to more Community members reading here.
I have tested your solution before, but there are several who will use this workbook. So I want to retrieve the files via this userform and listbox to prevent unwanted events.
- NikolinoDEFeb 26, 2021Platinum Contributor
The error is in the line marked in red because you obviously do not have this path
SubFolderName = "E:\ICP-Smartmål\Ny fil fra ICP"
Fixed it a bit and when I entered my path it worked.
Enclosed the file, adjust the path on your pc and it will work.
Don't forget to enter enough backslash, including at the end.
I would be happy to know if I could help.
Nikolino
I know I don't know anything (Socrates)
- MortenK77Feb 26, 2021Copper Contributor
Thank's, it's a step in right direction, but I still struggling to import the selected csv file from the listbox to a new sheet1 in my open woorkbook. I hope a good code under the import file button will import the file.
- NikolinoDEMar 12, 2021Platinum Contributor
Sorry I had forgotten, thought that I had already answered you.
But after looking closely at my post, I see that I have neglected this.
Enclosed the file with my suggested solution.
The subtleties of where to look and what you can easily set it up in the VBA code as you wish.
I hope, even if with some delay, that I was able to offer you a suggested solution that suits your needs.
If this information helped you, please mark this post as "Correct answer" and click on like (hand with thumbs up), so that other members can benefit from this information later.
Thank you for your understanding and patience
Nikolino
I know I don't know anything (Socrates)