Excel VBA Course

(35% Sale Ends Jan. 26)

Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course (35% Discount)

How to use the CSV Files


Not able to read the data from CSV file usign the file from following link.

Changed the tab to other in script file as well.

Automated Text Import in Excel with File Selection - The Easy Way - VBA


Hi Gurav

Not sure which link you mean (the cited tutorial? ) and without details (i.e. what happens when you try, on several CSV files?), your question is more like a complaint and can't be addressed
John_Ru (rep: 2867) Nov 24, '21 at 2:09 pm
Hi John,
I have downloaded your example file and tried to import CSV file having ; as data seperator. As advised in video I have changed the script from tab to other. When I am reading my CSV file with modified script everything is being read in the first cell itself.
Gaurav Nov 24, '21 at 10:33 pm
Add to Discussion




Your question doesn't give much detail or a file but from the discussion (above), it seems your CSV file has a semi-colon as a spearator (so it's not really in Comma Separated Values format!). Assuming you don't want to convert them to text files, I suggest you try this modified section to the code accompanying Don's video tutorial (changes in bold):

        Workbooks.OpenText _
            Filename:=fileToOpen, _
            StartRow:=2, _
            DataType:=xlDelimited, _
            Semicolon:=True, _
            Local=True _
Hope this helps.

Answer the Question

You must create an account to use the forum. Create an Account or Login