Sub
DataImport()
Dim
Customerworkbook
As
Workbook, MyWorkbook
As
Workbook
Dim
customerFilename
As
Variant
Dim
Pathname
As
String
Dim
FileName
As
String
Dim
LastRow_Cust
As
Integer
Dim
LastRow_Wb
As
Integer
Application.ScreenUpdating =
False
Set
MyWorkbook = Application.ActiveWorkbook
LastRow_Wb = Worksheets(2).Range(
"A2"
).CurrentRegion.Rows.Count
MyPath =
"C:\Users\HerveBigSmall2013\Desktop\9324920011"
ChDrive MyPath
ChDir MyPath
FileName = Application.GetOpenFilename(FileFilter:=
"Text Files (*.asc),*.asc"
)
Workbooks.OpenText FileName:=sPath & FileName, _
Origin:=xlMSDOS, StartRow:=1, DataType:=xlDelimited, TextQualifier:= _
xlDoubleQuote, ConsecutiveDelimiter:=
False
, Tab:=
False
, Semicolon:=
False
_
, Comma:=
False
, Space:=
False
, Other:=
True
, OtherChar:=
";"
, Local:=
True
Set
Customerworkbook = Application.ActiveWorkbook
LastRow_Cust = Worksheets(1).Range(
"A2"
).CurrentRegion.Rows.Count
For
i = 1
To
LastRow_Cust
MyWorkbook.Sheets(2).Rows(LastRow_Wb + 1 &
":"
& LastRow_Wb + 1).Insert Shift:=xlDown
Next
i
Customerworkbook.Worksheets(1).Range(
"A2"
&
":AAW"
& LastRow_Cust).Copy Destination:=MyWorkbook.Sheets(2).Range(
"A"
& LastRow_Wb + 1 &
":AAW"
& LastRow_Wb + 1).Cells
End
Sub