Spreadsheet Comparison Help

NeoSez

Board Regular
Joined
Aug 14, 2020
Messages
210
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
Noob here.
I have tried so many different ways to compare and find the changes of Columns L&M based on Q.
Tried Access but it only exports two columns and I have no idea what it is referencing OR it extracts all rows. I don't really know my way around ACCESS.
Tried Conditional formatting but it didn't work.
Tried everything.

What I need:
  • Find what rows have changes in columns L&M from the daily UPDATES sheet, compared to the current running DATA sheet and highlight.
  • Highlight / add the changes to DATA sheet col L&M from UPDATES sheet col L&M
  • Any new rows found in the UPDATES sheet, also add to the DATA sheet
  • Col Q is the unique ID #.
What is the easiest method please.
Greatly appreciate your help.

ABCDEFGHIJKLMNOPQ
DATEPetLocationFIRST_NAMELAST_NAMEEMAILTELEPHONEADDRESSCITYPROVINCEPOSTAL_CODECALLEDVISITEDStatusVetDescUnique ID
dd/mm/yyyySheepyesno123
dd/mm/yyyyDognono456
dd/mm/yyyyRabbityesyes789
DATA TAB



ABCDEFGHIJKLMNOPQ
DATEPetLocationFIRST_NAMELAST_NAMEEMAILTELEPHONEADDRESSCITYPROVINCEPOSTAL_CODECALLEDVISITEDStatusVetDescUnique ID
dd/mm/yyyySheepyesyes123
dd/mm/yyyyDognoyes456
dd/mm/yyyyRabbityesyes789
dd/mm/yyyyCatnono666
dd/mm/yyyyBirdnono777
UPDATES
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
How about
VBA Code:
Sub NeoSez()
   Dim Cl As Range
   Dim Dic As Object
   Dim UsdRws As Long
   
   Set Dic = CreateObject("scripting.dictionary")
   With Sheets("Data")
      UsdRws = .Range("Q" & Rows.Count).End(xlUp).Row
      For Each Cl In .Range("Q2:Q" & UsdRws)
         If Not Dic.Exists(Cl.Value) Then Dic.Add Cl.Value, Array(Cl, Cl.Offset(, -5).Value, Cl.Offset(, -4).Value)
      Next Cl
   End With
   With Sheets("Updates")
      For Each Cl In .Range("Q2", .Range("Q" & Rows.Count).End(xlUp))
         If Dic.Exists(Cl.Value) Then
            If Cl.Offset(, -5).Value <> Dic(Cl.Value)(1) Then
               Dic(Cl.Value)(0).Offset(, -5).Value = Cl.Offset(, -5).Value
               Dic(Cl.Value)(0).Offset(, -5).Interior.Color = vbYellow
            End If
            If Cl.Offset(, -4).Value <> Dic(Cl.Value)(2) Then
               Dic(Cl.Value)(0).Offset(, -4).Value = Cl.Offset(, -4).Value
               Dic(Cl.Value)(0).Offset(, -4).Interior.Color = vbYellow
            End If
         Else
            Cl.EntireRow.Copy Sheets("Data").Range("A" & UsdRws + 1)
            Sheets("Data").Range("A" & UsdRws + 1).Resize(, 17).Interior.Color = vbYellow
            UsdRws = UsdRws + 1
         End If
      Next Cl
   End With
End Sub
 
Upvote 0
Solution
How about
VBA Code:
Sub NeoSez()
   Dim Cl As Range
   Dim Dic As Object
   Dim UsdRws As Long
  
   Set Dic = CreateObject("scripting.dictionary")
   With Sheets("Data")
      UsdRws = .Range("Q" & Rows.Count).End(xlUp).Row
      For Each Cl In .Range("Q2:Q" & UsdRws)
         If Not Dic.Exists(Cl.Value) Then Dic.Add Cl.Value, Array(Cl, Cl.Offset(, -5).Value, Cl.Offset(, -4).Value)
      Next Cl
   End With
   With Sheets("Updates")
      For Each Cl In .Range("Q2", .Range("Q" & Rows.Count).End(xlUp))
         If Dic.Exists(Cl.Value) Then
            If Cl.Offset(, -5).Value <> Dic(Cl.Value)(1) Then
               Dic(Cl.Value)(0).Offset(, -5).Value = Cl.Offset(, -5).Value
               Dic(Cl.Value)(0).Offset(, -5).Interior.Color = vbYellow
            End If
            If Cl.Offset(, -4).Value <> Dic(Cl.Value)(2) Then
               Dic(Cl.Value)(0).Offset(, -4).Value = Cl.Offset(, -4).Value
               Dic(Cl.Value)(0).Offset(, -4).Interior.Color = vbYellow
            End If
         Else
            Cl.EntireRow.Copy Sheets("Data").Range("A" & UsdRws + 1)
            Sheets("Data").Range("A" & UsdRws + 1).Resize(, 17).Interior.Color = vbYellow
            UsdRws = UsdRws + 1
         End If
      Next Cl
   End With
End Sub
A million THANK YOU's

Fluff!​

That worked!!!!!
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,784
Messages
6,121,535
Members
449,037
Latest member
tmmotairi

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top