Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Having trouble importing CSV files with a macro
Hi all,
I'm having a problem with a small amount of VB code I've written fo use with Excel on my mac (Excel X). I need to prompt the user to selec a particular CSV file, copy it, and paste it into the current workshee I'm using. When I open the CSV file i'm using it populates it correctly, but a soon as I use the macro some of the cells end up being merged into on cell. Am i using the correct datatype for CSV? If so, has anyone go any other ideas as to what might be wrong? Sub Test() Dim sImportFile sImportFile = Application.GetOpenFilename Workbooks.OpenText FileName:=sImportFile, DataType:=xlDelimited Comma:=True ActiveSheet.UsedRange.Select Selection.Copy ActiveWorkbook.Close Worksheets("Marks and Grades").Range("A1").Activate ActiveSheet.Paste End Sub Thanks a lot in advance, Lia -- Message posted from http://www.ExcelForum.com |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Importing and merging Excel files by using a macro | Excel Discussion (Misc queries) | |||
Macro for importing text files but the file name changes | Excel Worksheet Functions | |||
trouble with pxl files | Excel Discussion (Misc queries) | |||
importing from notepad trouble | Excel Discussion (Misc queries) | |||
Having trouble with web query, importing not consistent. | Excel Discussion (Misc queries) |