I have the code below, which allows our team to edit a document that we all have access to, and then uploads the new data to our larger file which only a few have access to. However, we’re now looking to be able to edit the data in either file, have the code do the same basic thing, but compare both files first, and carry any new information from the larger file into the smaller file before using the smaller file to overwrite the data in the larger. (And that really sounds confusing typing it out, so I hope it makes sense.)

Essentially, I want John to be able to work in the smaller file and make updates while Jane maintains the larger file making her own updates in it. Then I want the code to carry over Jane’s updates into John’s file without duplicating or losing any of the data that was already there. Then I want to code clear the data on Jane’s file and paste in all of the (now combined) data from John’s file.

I’m still a complete newbie to VBA, so when offering suggestions, if you could give me the complete code or at least tell me exactly where in the code any new lines would go, I would really appreciate it.

Note: My sample code shows the file location as desktop because I cannot publish the actual name of our drive, but it is a share drive that we all have access to.

'Replace Data on Budget Changes Tab
Sub RunReport()
 
 
Sheets("Budget Changes").Cells.Delete
 
 
Dim x As Workbook, y As Workbook
 
 
Dim ws1 As Worksheet, ws2 As Worksheet
 
 
Set x = Workbooks("Budget & Execution Tool")
Set y = Workbooks.Open("C:\Users\doej\Desktop\BudgetChanges Tab Only")
 
 
Set ws1 = x.Sheets("Budget Changes")
Set ws2 = y.Sheets("Budget_Changes")
 
 
ws2.Cells.Copy ws1.Cells
 
 
Workbooks("Budget Changes Tab Only").Close
 
 
End Sub