Hi

I'm trying to create a macro that will fetch the emp id's from sheet 2 and and will be pasted to sheet 1 upon another..till now i'm not able to figure out why the second file I import fits into a1 and the previous records slides to the right. please help code follows:-

Sub getit()
Dim FileName As String, Path As String
FileName = Sheet2.Cells(1, 1)
Path = "TEXT;D:\Rajiv\Feb 4\0530\2954\" & FileName & ".txt"
With ActiveSheet.QueryTables.Add(Connection:=Path, Destination:=Range("A1"))
.Name = FileName
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 850
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = False
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = True
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
Sheets("Sheet2").Select
Range("A1").Select
Selection.Delete Shift:=xlUp
Sheets("Sheet1").Select
Selection.End(xlDown).Select
End Sub