Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
No, but you could create a macro that would open each of your .csv files, format
it the way you want, save it (and repeat). Start a new workbook and record a macro when you open one of the CSV files. Continue recording when you format it. Then you can tweak the macro to look more like: Option Explicit Sub testme() Dim myFileNames As Variant Dim iCtr As Long Dim wkbk As Workbook Dim NewFileName As String myFileNames = Application.GetOpenFilename _ ("CSV Files, *.csv", MultiSelect:=True) If IsArray(myFileNames) = False Then Exit Sub 'user hit cancel End If For iCtr = LBound(myFileNames) To UBound(myFileNames) NewFileName _ = Left(myFileNames(iCtr), Len(myFileNames(iCtr)) - 4) & ".xls" Set wkbk = Workbooks.Open(Filename:=myFileNames(iCtr)) 'do your formatting 'save the workbook Application.DisplayAlerts = False wkbk.SaveAs Filename:=NewFileName Application.DisplayAlerts = True wkbk.Close savechanges:=False Next iCtr End Sub The multiselect stuff allows you to click on the first and ctrl-click on subsequent in the File|open dialog. That way you just select the ones you want to convert. If you're new to macros, you may want to read David McRitchie's intro at: http://www.mvps.org/dmcritchie/excel/getstarted.htm Chip wrote: I have a series of CSV files that ned to be converted to XLS and reformatted at the same time. Is there any way to click on the CSV file and have it open into a preformatted XLS spread sheet that can then be saved in the XLS file type? -- Dave Peterson |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
CSV formatted files open odly in Excel 2000 | Excel Discussion (Misc queries) | |||
Excel 2003 Inserted pictures formatted in PNG format. | Excel Discussion (Misc queries) | |||
How to change default cell format to "Text" | Excel Discussion (Misc queries) | |||
Click on Excel Doc Starts Excel but Excel does not Open the Doc. | Excel Discussion (Misc queries) | |||
trying to open an excel file in excel 2003 | Excel Discussion (Misc queries) |