I have 4 sheets in total that need to be used.
The sheet names with a (1) next to them are the reports from last week and the sheet names with a (2) next to them are the reports from this week.
In each sheet, there are multiple columns which I get rid of so that all that remains is one column with either the Server Name or the Machine Name as the column header
Essentially, I need to compare last weeks report with this weeks report and see what the differences are.
I received the bit bit of code below here:
At first, it appeared to be working, by chance I took a random name and it showed on the one sheet and not the other. But now I see it doesn't work..
Public Sub FindDifferences1()
Dim firstRange As Range
Dim secondRange As Range
Dim myCell As Range
Dim wks1 As Worksheet, wks2 As Worksheet, wks3 As Worksheet
'Find Removed Wintel Servers
Set wks1 = ActiveWorkbook.Sheets("Last Week Servers List")
Set wks2 = ActiveWorkbook.Sheets("This Week Servers List")
Set wks3 = ActiveWorkbook.Sheets("New Servers")
Set firstRange = wks1.Range("A:A")
Set secondRange = wks2.Range("A:A")
For Each myCell In firstRange
If myCell <> secondRange.Range(myCell.Address) Then
wks3.Cells(Rows.Count, 2).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues
wks3.Cells(Rows.Count, 2).End(xlUp).PasteSpecial xlPasteFormats
Before I get to this section, I make sure to highlight the cells on the worksheets - each worksheet has a different colour. So that, in theory, with the above code, when it copies, it will copy the cell colour too, indicating which sheet has the difference.