How can I load a csv as a sheet of the current workbook in Excel-vba 2007 ?
Asked
Active
Viewed 2,534 times
2 Answers
1
I suppose you would need to save it as a csv file. Something like this:
ActiveWorkbook.SaveAs Filename:="c:\whatever.csv", FileFormat:=xlCSV
See here for more on how to use the SaveAs method.
Is this what you're after?
EDIT
Or if what you're after is to import a csv file like Jerry answered but with VBA, then I believe you use the OpenText method.
Workbooks.OpenText FileName:="c:\whatever.csv"

mattboy
- 2,870
- 5
- 26
- 40
0
You would use the Data > Import data > (choose file) > import options > [x] New Worksheet

Jerry Beaucaire
- 3,133
- 16
- 14