_____ Workbook: sample2.csv ( Using Excel 2007 32 bit )Code:Sub OpenVBASample2_csv_5June() ' ' Workbooks.Open Filename:=ThisWorkbook.Path & "\" & "Sample2.csv" Workbooks.Open Filename:=ThisWorkbook.Path & Application.PathSeparator & "Sample2.csv" ' CHANGE TO SUIT End Sub
Worksheet: sample2
Row\Col A B C D E F G H I J K L M N O P Q R S T U V W X 1NSE 101010 6< 12783A GTT 2NSE 22 6< 12783A GTT 3NSE 17388 6< 12783A GTT 4 100 5 25 6 7 8 9 10 11 12 13 14 15 16Only for understanding purpose 17 18Before runing the macro 19 20NSE 101010 6< 12783A GTT 21NSE 22 6< 12783A GTT 22NSE 17388 6< 12783A GTT 23 24 25 26 27After runing the macro 28 29 30 31NSE 101010 6< 12783A GTT 32NSE 22 6< 12783A GTT 33NSE 17388 6< 12783A GTT 34 100 35 25
Note : Sometimes Excel manually or Excel VBA will open .csv file and put values across column cells. but also sometimes Excel manually or Excel VBA will open .csv file and put all values and commas in first cell




Reply With Quote
Bookmarks