LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Macro issue

Alex,

Try this

Sub macro1()
Dim oThisFile As Workbook '<<<<<<<<<<<<<<<<<<<< New code
Workbooks.OpenText Filename:="E:\UDC\2.TXT", Origin:=xlWindows,
Set oThisFile As ActiveWorkbook '<<<<<<<<<<<<<<<<<<<< New code
StartRow _
:=7, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, _
ConsecutiveDelimiter:=True, Tab:=True, Semicolon:=False,
Comma:=False, _
Space:=True, 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),
Array(8, 1))
Range("F13").Select
Selection.Copy
Windows("DAILY OPERATIONS_2004.xls").Activate
Range("C8").Select
ActiveSheet.Paste
Range("E8").Select
Windows("2.TXT").Activate
Range("F14").Select
Application.CutCopyMode = False
Selection.Copy
Windows("DAILY OPERATIONS_2004.xls").Activate
ActiveSheet.Paste
Range("J8").Select
Windows("2.TXT").Activate
Range("E17").Select
Application.CutCopyMode = False
Selection.Copy
Windows("DAILY OPERATIONS_2004.xls").Activate
ActiveSheet.Paste
Range("K8").Select
Windows("2.TXT").Activate
Range("G18").Select
Application.CutCopyMode = False
Selection.Copy
Windows("DAILY OPERATIONS_2004.xls").Activate
ActiveSheet.Paste
ActiveWindow.LargeScroll ToRight:=2
Range("AI8").Select
Windows("2.TXT").Activate
Range("F18").Select
Application.CutCopyMode = False
Selection.Copy
Windows("DAILY OPERATIONS_2004.xls").Activate
ActiveSheet.Paste

oThisFile.Close '<<<<<<<<<<<<<<<<<<<< New code

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"alexm999 " wrote in message
...
Here's the code:

what can i add to get the file 2.txt to close at the end?





 
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
Issue with a macro juancarlos Excel Discussion (Misc queries) 18 September 17th 09 09:41 PM
Macro issue 2 Farhad Excel Discussion (Misc queries) 6 December 21st 08 07:14 PM
Macro issue Farhad Excel Discussion (Misc queries) 5 December 21st 08 06:05 PM
Macro issue Sue Excel Discussion (Misc queries) 0 October 8th 08 08:05 PM
Macro Issue basanth New Users to Excel 3 September 10th 08 06:05 PM


All times are GMT +1. The time now is 04:28 AM.

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"