Alex,
Here is one way.
I have also shortened your code, although I admit to getting lost as to
where it was being copied to, so if you use it, check all the destinations
and correct them.
Sub Test()
Select Case ActiveSheet.Name
Case "101-JAN04": myMacro "c:\UDC\101\"
End If
End Sub
Sub myMacro(sh As String)
Application.DisplayAlerts = False
Workbooks.OpenText Filename:=sh & "1.TXT", _
Origin:=xlWindows, _
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))
If Range("A:A").Find(what:="DEV") Is Nothing Then
Range("A16").EntireRow.Insert shift:=xlDown
End If
Windows("1.txt").Range("E62").Copy Destination:= _
Windows("DAILY OPERATIONS_2004.xls").Range("AL9")
Windows("1.txt").Range("I62").Copy Destination:= _
Windows("DAILY OPERATIONS_2004.xls").Range("C9")
Windows("1.txt").Range("F13").Copy Destination:= _
Windows("DAILY OPERATIONS_2004.xls").Range("C9")
Windows("1.TXT").Range("F14").Copy Destination:= _
Windows("DAILY OPERATIONS_2004.xls").Range("C9")
Windows("1.TXT").Range("E17").Copy Destination:= _
Windows("DAILY OPERATIONS_2004.xls").Range("C9")
Windows("1.TXT").Range("G18").Copy Destination:= _
Windows("DAILY OPERATIONS_2004.xls").Range("C9")
Windows("1.TXT").Range("F18").Copy Destination:= _
Windows("DAILY OPERATIONS_2004.xls").Range("C9")
Windows("1.TXT").Close
ActiveWindow.LargeScroll ToRight:=-2
ActiveWindow.ScrollColumn = 1
Application.DisplayAlerts = True
End Sub
--
HTH
Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)