LMGTFY
https://en.wikipedia.org/wiki/Hash_function
A hash function is any
function that can be used to map
data of arbitrary size to fixed-size values. The values returned by a hash function are called hash values, hash codes, digests, or simply hashes. The values are usually used to index a fixed-size table called a
hash table. Use of a hash function to index a hash table is called hashing or scatter storage addressing.
I had a Hash module that I added to the attachment.
The test data in the attachment (your folder tree) was order randomized
The MarkDupsWithHash sub was run to mark dups in red
The data was resorted as a check
Option Explicit
Sub MarkDupsWithHash()
Dim r As Range
Dim aryHash() As String
Dim i As Long, j As Long
'test
Worksheets("Files").Columns(1).Interior.ColorIndex = xlColorIndexNone
Set r = Worksheets("Files").Cells(1, 1)
Set r = Range(r, r.End(xlDown))
ReDim aryHash(1 To r.Rows.Count)
For i = LBound(aryHash) To UBound(aryHash)
aryHash(i) = CreateSHA256HashString(r.Cells(i, 1).Value)
Next i
For i = LBound(aryHash) To UBound(aryHash) - 1
For j = i + 1 To UBound(aryHash)
If aryHash(j) = aryHash(i) Then r.Cells(j, 1).Interior.Color = vbRed
Next j
Next i
MsgBox "Done"
End Sub
If you don't want to use a Hash, then the For i / For j loops should also work, but will be slower I think