Good morning all,
I have a couple of identical worksheets that my coworkers use to capture some data. I then want to import their data into a master sheet. The data is laid out in tabular form (see image1), and at the end of the row there is a formula that calculates a result (Pass/Fail) based on the values entered in the preceding columns.
What I'm trying to do is to copy the data from the coworker sheets and append that data to the same structured table in a master sheet. I am able to accomplish all of this, with one exception. The formula that gets copied into the master sheet still refers to the cells in the original coworker sheet (see image2). I cant seem to figure out how to have that formula simply refer to the same cells in the master sheet. I've tried various iterations of the PasteSpecial options (xlpastevalues, xlpasteformulas, etc), but to no avail. Some of my attempts are remarked out in the code below.
NOTE: Image2 shows the results of the copied data in the Master workbook, but the formula for the Result column is still referencing the original sheet it came from, which is "Staff Ticket Review 2022 - Scott.xlsm".
Here is the "copy" code which works exactly as I want except for the formula reference. "sht1" (and all 1's) refer to the master sheet being copied to, and "sht2" (and all 2's) refer to the individual co-worker sheet I am copying from.
' copy the data from tblTableName2
'sht2.Activate
' tblTableName2.Range("A" & StartRow2 & ":R" & BRow2).Copy 'Destination:=tblTableName1.Range("A" & StartRow1)
With tblTableName2
.DataBodyRange.Copy Destination:=sht1.Range("A" & StartRow1)
End With
' copy to tblTableName1
' sht1.Activate
' 'tblTableName1.Range("A" & StartRow1).PasteSpecial
' sht1.Range("A" & StartRow1).PasteSpecial xlPasteFormulas
'
Bookmarks