Hi Experts

I have a simple code that computes time duration between 2 times in minutes. For example, 10:00 am to 2:00 pm is 240 minutes. And 6:15 pm to 9:15 pm is 180 minutes.

BUT, when I attempt to roll over to the next day ie 10:00 pm to 2:00 am, I keep getting -1200 minutes.

I searched but can not find a quick code that will compute this correctly to 240 minutes.


Here is my code so far:
Private Sub CommandButton1_Click()
Dim lr As Integer
Dim dur As Long


lr = Sheet1.Cells(Rows.Count, 1).End(xlUp).Row

For i = 1 To lr

dur = DateDiff("s", Cells(i, 1), Cells(i, 2))

Cells(i, 4).Value = dur / 60




Next

End Sub