I am having issues with the data being placed in the master workbook which contains multiple worksheets that have data tables In one case if SHNames = "Proj Sum" then it is placed outside of the table and not recognized by Pivot table, the other if the shName = "ResPlan_Da ta", there are multiple rows of blank lines in the Table and no data is updated.

Please help to correct the code accordingly. Sample file...