Hi Steve
Essentially you need to Resize the Table...this Code does that and appears to do as you require
Option Explicit
Sub GetData()
Dim wb As Workbook
Dim ws As Worksheet
Dim LR As Long, LR1 As Long
Set wb = ThisWorkbook
Set ws = wb.Sheets("NALCOMIS_Data")
With ws
LR = .Range("A" & .Rows.Count).End(xlUp).Row
.Range("A2:O" & LR).ClearContents
If LR > 2 Then
With .Range("P3:U" & LR)
.ClearContents
.Interior.TintAndShade = 0
.Interior.Pattern = xlNone
End With
End If
End With
With ws.ListObjects("WIP")
.Resize Range("$A$1:$U$2")
End With
Application.ScreenUpdating = False
' ChDir "C:\Documents and Settings\Administrator\Desktop\Steve N"
ChDir "C:\Users\Steve\Desktop\Test folder"
' Workbooks.Open Filename:="C:\Documents and Settings\Administrator\Desktop\Steve N\HIST.xlsx"
Workbooks.Open Filename:="C:\Users\Steve\Desktop\Test folder\HIST.xlsx"
With Sheets("NALCOMIS_Data")
LR1 = .Cells.Find("*", .Cells(.Rows.Count, .Columns.Count), SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious).Row
.Range("A2:O" & LR1).Copy
ws.Range("A2").PasteSpecial
End With
ActiveWorkbook.Close , False
' Workbooks.Open Filename:="C:\Documents and Settings\Administrator\Desktop\Steve N\WIP.xlsx"
Workbooks.Open Filename:="C:\Users\Steve\Desktop\Test folder\WIP.xlsx"
With Sheets("NALCOMIS_Data")
LR1 = .Cells.Find("*", .Cells(.Rows.Count, .Columns.Count), SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious).Row
.Range("A2:O" & LR1).Copy
With ws
LR = .Range("A" & .Rows.Count).End(xlUp).Row + 1
ws.Range("A" & LR).PasteSpecial
End With
End With
ActiveWorkbook.Close , False
With ws
.Cells.EntireColumn.AutoFit
.Range("A2").Select
End With
Application.ScreenUpdating = True
End Sub
Bookmarks