Latest code below.... Couple of issues -
- paste copies data to Col3 on the destination sheet not col 1
- I think may need to sort the source data by column a before selecting the data - I got an error saying could not run the command over multilple selections (unless there is another way to cup and paste it) 3 after the update has been done could do with resize of the destination table to include all the new rows added as part of the table...
I have spent time looking into solving all these myself so I don't want you to think I am not trying :-)
Appreciate all the help being given!
Dim MFST_LastRow As Long
' Get work sheet
Set wsf = Sheets("TASK - Map and Validation")
Set wst = Sheets("MASTER - Supplier File")
' Get table
Set tblMSFT = wst.ListObjects("MSF_Table")
Set tblMAV = wsf.ListObjects("MAV_Table")
'Sort Table
End With
' Filter table
tblMAV.Range.AutoFilter Field:=1, Criteria1:="New"
' Copy filtered table
tblMAV.DataBodyRange.SpecialCells(xlCellTypeVisible).Copy
Set visRange = tblMAV.DataBodyRange.SpecialCells(xlCellTypeVisible)
Set visRange = Application.Intersect(visRange, wsf.Columns("B:R"))
visRange.Copy
' Get the last data row #
With tblMAV.Range
MFST_LastRow = wst.Cells(.Cells.Count).Row
MsgBox (MFST_LastRow)
End With
' Paste as values
Application.ScreenUpdating = False
MsgBox ("B4 PASTE")
wst.Cells(MFST_LastRow + 1, 1).PasteSpecial xlPasteValues
'tblMAV.AutoFilter.ShowAllData
MsgBox "New Records Added", vbExclamation, PROC_TITLE
Application.ScreenUpdating = True
'========================================
Copy a Specified Number of Columns From One Table to Another