Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The following macro imports the .csv file starting at row 1 of the file:
Sub OpenCSV() Workbooks.OpenText Filename:="C:\Categories.csv", StartRow:=2, DataType:=xlDelimited, Origin:=437, _ TextQualifier:=xlDoubleQuote, _ ConsecutiveDelimiter:=False, Semicolon:=False, Comma:=True ActiveWorkbook.Activate ActiveWindow.Visible = True End Sub Where Categories.csv contains: CategoryID,CategoryName,Description CategoryID,CategoryName,Description 1,Beverages,"Soft drinks, coffees, teas, beers, and ales" 2,Condiments,"Sweet and savory sauces, relishes, spreads, and seasonings" 3,Confections,"Desserts, candies, and sweet breads" 4,Dairy Products,Cheeses 5,Grains/Cereals,"Breads, crackers, pasta, and cereal" 6,Meat/Poultry,Prepared meats 7,Produce,Dried fruit and bean curd 8,Seafood,Seaweed and fish Please help me understand why this happens (Excel 2003). -- John Saunders johnwsaunders at hotmail.com |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Workbooks.OpenText does not work on XP. HELP !!! | Excel Programming | |||
How to open UTF-8 files with Workbooks.OpenText | Excel Programming | |||
After OpenText all pastes from external apps use format from OpenText | Excel Programming | |||
Workbooks.OpenText | Excel Programming | |||
Using Workbooks.OpenText to read a tab-delimited file into a worksheet | Excel Programming |