If InStr(Cells(r, 1), "Group key") = 1
should not be

If InStr(Cells(r, 1), "Group key") >0
?