Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi.
I'm trying to write a macro that will open up a text file in excel, do a bunch of formatting stuff, then save the file with a specified name (as in the Save As dialogue box, doing it manually) as a .xls file. I've got the first couple of bits sorted, but I've run up against a bit of a roadblock with the saving part. Any help would be greatly appreciated. My code so far looks like: Workbooks.OpenText Filename:= _ "S:\International department\2006 Projects\Master Cat Pricing Model\Adding AIR\Catrader Output.txt" _ , Origin:=xlMSDOS, StartRow:=1, DataType:=xlDelimited, TextQualifier:= _ xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, Semicolon:=False _ , Comma:=True, Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), _ Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), Array(7, 1)), _ TrailingMinusNumbers:=True ActiveWindow.ActivateNext ActiveWindow.ActivateNext ActiveCell.Rows("1:27").EntireRow.Select Selection.Insert Shift:=xlDown ActiveCell.Offset(26, 0).Rows("1:1").EntireRow.Select Selection.Insert Shift:=xlDown ActiveCell.Select ActiveCell.FormulaR1C1 = "Event ID" ActiveCell.Offset(0, 4).Range("A1").Select ActiveCell.FormulaR1C1 = "Loss" Range("A1").Select I want to save and close the file immadiately after this. Thanks, Eileen. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Seeing Text File Names when Saving Excel Files | New Users to Excel | |||
saving excel files | New Users to Excel | |||
Saving Excel files on the Web | Excel Discussion (Misc queries) | |||
Saving text files in excel 95 foremat | Excel Programming | |||
Saving spreadsheets as delimited text files | Excel Programming |