How can I do this macro do for other pages also it is ok for first page
Private Sub CommandButton1_Click()
tm = Cells(60000, 1).End(xlUp).Row
For i = 2 To tm
s = 0
For Each x In Range(Cells(1, 1), Cells(1, 22))
For Each y In Range(Cells(i, 1), Cells(i, 22))
If x = y Then
s = s + 1
y.Font.ColorIndex = 3
End If
Next y, x
Cells(i, 24) = s
Next i
End Sub
Private Sub CommandButton1_Click()
tm = Cells(60000, 1).End(xlUp).Row
For i = 2 To tm
s = 0
For Each x In Range(Cells(1, 1), Cells(1, 22))
For Each y In Range(Cells(i, 1), Cells(i, 22))
If x = y Then
s = s + 1
y.Font.ColorIndex = 3
End If
Next y, x
Cells(i, 24) = s
Next i
End Sub