Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How do I automate the process of importing a CSV .TXT file into an empty
worksheet and placing it in rows and columns in Excel starting in cell A1? How will the macro select comma and tab delimited and possibly "unicode" text for Excel 2003 so that my values in the CSV .txt file are put into separate cells in Excel? I would like to know how to do this in Excel 2000 and 2003. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Here's a sub which will open a file and copy the contenets to a
specified location, then close the file Sub PlaceFile(sPath As String, CopyTo As Range) Dim wb As Workbook Workbooks.OpenText Filename:=sPath, Origin:=437, _ StartRow:=1, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, _ ConsecutiveDelimiter:=False, Semicolon:=False, Comma:=True With ActiveWorkbook .Worksheets(1).UsedRange.Copy CopyTo .Close False End With End Sub Sub Tester() PlaceFile "C:\Analysis\tempFile.txt", ActiveSheet.Range("A1") End Sub Tim "Ryan Cain" wrote in message ... How do I automate the process of importing a CSV .TXT file into an empty worksheet and placing it in rows and columns in Excel starting in cell A1? How will the macro select comma and tab delimited and possibly "unicode" text for Excel 2003 so that my values in the CSV .txt file are put into separate cells in Excel? I would like to know how to do this in Excel 2000 and 2003. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
macro-import another xls file | Excel Discussion (Misc queries) | |||
Error in large file import macro | Excel Programming | |||
macro to import file (help with a piece of code) | Excel Programming | |||
macro which import alfa*.txt file, how to ? | Excel Programming | |||
Import text file without specifying a path macro won't work | Excel Programming |