Showing Error :Index Was Out Of Range. In Datagridview Please Help….

hello
sir
getting error when run the loop and going to last value of row count
please help

and i can not use the 2nd loop in the place of cells(?????) number how can i use this

Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

What I have tried:***

Dim aa As Integer
       For Z1 = 0 To DataGridView1.RowCount

           If Me.DataGridView1.Rows(Z1).Cells(2).Value = True Then
               aa = 1
           Else
               aa = 0
           End If
           Me.DataGridView1.Rows(Z1).Cells(7).Value = aa
           If Me.DataGridView1.Rows(Z1).Cells(3).Value = True Then
               aa = aa & 1
           Else
               aa = aa & 0
           End If
           Me.DataGridView1.Rows(Z1).Cells(7).Value = aa
           If Me.DataGridView1.Rows(Z1).Cells(4).Value = True Then
               aa = aa & 1
           Else
               aa = aa & 0
           End If
           Me.DataGridView1.Rows(Z1).Cells(7).Value = aa
           If Me.DataGridView1.Rows(Z1).Cells(5).Value = True Then
               aa = aa & 1
           Else
               aa = aa & 0
           End If
           Me.DataGridView1.Rows(Z1).Cells(7).Value = aa
           If Me.DataGridView1.Rows(Z1).Cells(6).Value = True Then
               aa = aa & 1
           Else
               aa = aa & 0
           End If
           Me.DataGridView1.Rows(Z1).Cells(7).Value = aa
       Next