Sub Macro1()
'
' Macro1 Macro
' Macro recorded 5/21/03 by Peter Porto
'
'
ChDir "C:\WINDOWS\Desktop"
Workbooks.OpenText Filename:="C:\WINDOWS\Desktop\LAUS-ALMIS.txt", Origin:= _
xlWindows, StartRow:=3, DataType:=xlDelimited, TextQualifier:= _
xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, _
Comma:=False, Space:=False, Other:=False, FieldInfo:=Array(Array(1, 9), _
Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), Array(7, 1), Array(8, 1), _
Array(9, 1))
Range("A1:G84").Select
Selection.Copy
Windows("Book1").Activate
ActiveSheet.Paste
Range("A1").Select
Windows("LAUS-ALMIS.txt").Activate
ActiveWindow.Close
End Sub
Above is the macro that I am using. the overall purpose of the macro is to import a text file but do so in a very, specific manner. What should be happening is that three columns (D, E, and F) should contain data after the import is done. Instead it is J and K. . In this case, B and C are prepopulated with stuff. If the import was working correctly, columns D, E, and F would contain corresponding values from the text file. By looking at the macro, can you discern why it is shifting my values 4 columns to the right?
Bookmarks