Start a new workbook.
Start recording a macro when you open one *.txt file.
Keep recording when you add all your page setup, filters, headers, freezepanes,
anything you can think of.
Stop recording when you're done.
Close the workbook that contains that imported data--not the macro workbook.
Put a button from the Forms toolbar on a worksheet in that macro workbook.
Assign the macro to that button.
Since you'll want to pick and choose the file(s) to import, you won't want the
file name hardcoded into the macro.
Your code will contain some lines that look like this:
Workbooks.OpenText Filename:="C:\My Documents\excel\myfile.txt", _
Origin:=437, StartRow:=1, DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(1, 1), Array(5, 1), _
Array(15, 1), Array(24, 1), Array(38, 1))
You'll want to keep all the other stuff (formatting/headers/etc), but modify
this portion a bit.
Option Explicit
Sub testme01()
Dim wkbk As Workbook
Dim myFileNames As Variant
Dim NewFileName As String
Dim iCtr As Long
myFileNames = Application.GetOpenFilename("Text Files, *.txt", _
MultiSelect:=True)
If IsArray(myFileNames) = False Then
Exit Sub
End If
For iCtr = LBound(myFileNames) To UBound(myFileNames)
'modify this line according to your recorded macro
'fieldinfo:= will change
Workbooks.OpenText Filename:=myFileNames(iCtr), _
Origin:=437, StartRow:=1, DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(7, 1), _
Array(11, 1), Array(19, 1), Array(21, 1))
Set wkbk = ActiveWorkbook
'rest of recorded code
Next iCtr
End Sub
After you've built this macro to do what you want, you just open that macro
workbook and click that big button to import your file(s).
If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm