LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Saving Text Files in Excel

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Seeing Text File Names when Saving Excel Files jkiser New Users to Excel 4 January 1st 09 01:57 PM
saving excel files REB New Users to Excel 2 December 1st 07 04:06 PM
Saving Excel files on the Web Joe Excel Discussion (Misc queries) 0 September 23rd 05 05:40 PM
Saving text files in excel 95 foremat DAubrey Excel Programming 1 May 24th 04 09:54 AM
Saving spreadsheets as delimited text files rwebster3[_2_] Excel Programming 2 April 22nd 04 01:46 AM


All times are GMT +1. The time now is 05:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"