the code below works perfect unless the capital and lowercase don't match on otherwise identical words. Any advice?
Sub compareyears()
Dim i, j, k As Integer
Dim prev, curr As String
prev = Sheets("data").Cells(2, 1)
curr = Sheets("data").Cells(3, 1)
For i = 2 To Sheets(prev).Range("a1").End(xlDown).Row
For j = 2 To Sheets(curr).Range("a1").End(xlDown).Row
If Sheets(prev).Cells(i, 1).Value = Sheets(curr).Cells(j, 1).Value Then
For k = 2 To 10
If Sheets(prev).Cells(i, k).Value <> Sheets(curr).Cells(j, k).Value Then
Sheets(prev).Cells(i, k).Interior.ColorIndex = 42
Sheets(curr).Cells(j, k).Interior.ColorIndex = 42
End If
Next k
End If
Next j
Next i
End Sub
Sub compareyears()
Dim i, j, k As Integer
Dim prev, curr As String
prev = Sheets("data").Cells(2, 1)
curr = Sheets("data").Cells(3, 1)
For i = 2 To Sheets(prev).Range("a1").End(xlDown).Row
For j = 2 To Sheets(curr).Range("a1").End(xlDown).Row
If Sheets(prev).Cells(i, 1).Value = Sheets(curr).Cells(j, 1).Value Then
For k = 2 To 10
If Sheets(prev).Cells(i, k).Value <> Sheets(curr).Cells(j, k).Value Then
Sheets(prev).Cells(i, k).Interior.ColorIndex = 42
Sheets(curr).Cells(j, k).Interior.ColorIndex = 42
End If
Next k
End If
Next j
Next i
End Sub