MyFlight
Technical User
- Feb 4, 2002
- 193
Help I am trying to write a macro to Open Multiple (.txt) files located in the My Documents directory. After opening each file I want to CUT the contents and paste them into another spreadsheet (Master List.xls), then close the text file and move on to the next one. Since I have about 168 files I need to append it will take a long time manually.
I know how to open all of the files in the My Documents folder.
Sub Dpn_Formatting()
'
' Dpn_Formatting Macro
'
'
Application.ScreenUpdating = False
Application.DisplayAlerts = False
ChDir "C:\Temp Data Files\Raw Data"
Workbooks.OpenText Filename:="*.DPN", _
Origin:=437, StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=Array( _
Array(0, 2), Array(5, 2), Array(13, 2), Array(27, 2), Array(41, 2), Array(47, 2)), _
TrailingMinusNumbers:=True
However, I don't know how to cut and paste (append) the data to the Master List.xls file.
Any help would be appreicated.
I know how to open all of the files in the My Documents folder.
Sub Dpn_Formatting()
'
' Dpn_Formatting Macro
'
'
Application.ScreenUpdating = False
Application.DisplayAlerts = False
ChDir "C:\Temp Data Files\Raw Data"
Workbooks.OpenText Filename:="*.DPN", _
Origin:=437, StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=Array( _
Array(0, 2), Array(5, 2), Array(13, 2), Array(27, 2), Array(41, 2), Array(47, 2)), _
TrailingMinusNumbers:=True
However, I don't know how to cut and paste (append) the data to the Master List.xls file.
Any help would be appreicated.