Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
*.csv to *.xls
To All the more Intelligent People out there than I. (Thanks for the Input & Time) Here's what I'm trying to do. Build a Macro that opens a specific folder and looks for all *.csv and allows the individual to select a certain *.csv file and then Import it to the *.xls Workbook that is running the Macro. The *.csv file that is being imported already has the information in cells IE: It looks like a *.xls Have been messing around with this for far to long, tried building a seperate Macro just to convert the *.csv into a *.xls So that I can then CopyPaste the Information into the Workbook that I'm trying to get it into. However it just Saves my Original workbook instead of the *.csv Have posted before under "open command" (this is my second post ever) When I use record (which I do most of the time, and then modify) and the *.csv file is specified it works fine. Please Help I know this can be done. Sub Convert() ' ' Convert Macro ' Macro recorded 29/06/2006 by Si ' ' ChDir "C:\TEMP" Application.GetOpenFilename ("text files, *.csv") ActiveWorkbook.SaveAs Filename:="C:\TEMP\Import This.xls", FileFormat:=xlNormal, _ Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _ CreateBackup:=False End Sub Sub Import() ' ' Import Macro ' Macro recorded 29/06/2006 by Si ' ' Workbooks.Open Filename:="C:\TEMP\Import This.xls" Range("A1:AH19").Select Selection.Copy Windows("Excel Workbook.xls").Activate Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Range("A1").Select End Sub One Macro would be better but if I could get Individuals to Select *.csv and the Paste into *.xls that would save on my Workbook size? Cheers for any Help |