Looks like you're making it more complicated than it need be. Basically it's ...

DataGridView1.Rows(index1).Cells(index2).Style.BackColor = Color.Red

... so you need to use indexed loops rather than For Each.