Hello People I have a bit of a problem and was wondering if someone could help out. I have a datagridview with 5 bound columns and one unbound column. One of the columns is called total meter readings (Black) and is has all the values of the meter reading recorded throughout the month The purpose of the unbound columns is to calculate the difference between each reading. for e.g. one day, the reading might be 100, then the week after it will be 125. The row in the unbound column should calculate and display 25. and should continue to calculate and display a new difference value every time a new meter readings is entered. So Far I have typed this peace of code

Code:
For Each DataGridView In dataGridView4.Rows
            Dim i As Integer
            dataGridView4.Rows(i).Cells(5).Value = dataGridView4.Rows(i).Cells(3).Value - dataGridView4.Rows(i).Cells(3).Value
            i += 1
        Next
and this is the result i'm getting

Name:  datagridview.jpg
Views: 2338
Size:  13.4 KB

As you can see it looping but the difference is zero. The total meter readings are subtracting themselves. What I want is for the bottom reading to subtract the one above. Can anyone help with this please.