Excell 2007 VB Ver 6.5
I have a col with time in 1904 date format.
I have a col with monitored criteria, if this criteria falls below a certain level then I wish to know the time difference between the current cell row time and the current cell -1 row.
The only problem occurs when the time in the current cell is 00:00:17, and the time in the current cell-1 row is 23:55:17.
What I would like to do is paste the formula
'=Mod ((Current cell) -(Current Cell-1),1)'
into another cell, but every time I try to do it I get 'Application-defined or Object-Defined error'
Here is the code I have been using
For x = 4 To 19
y = x + 56
For counter = 3 To C Step 1 'Starts at row 3
Set curcell = Worksheets("All data").Cells(counter, x) ' Starts at Column D
curcell.Select
If curcell >= -30 Then
ActiveCell.Interior.ColorIndex = 3 'Highlights cell red
Z = counter - 1
Cells(counter, y) = "= mod (B" & counter & "-B" & Z & ",1)" 'Subtracts previous time from counter time
End If
Next counter
Next x
I have a col with time in 1904 date format.
I have a col with monitored criteria, if this criteria falls below a certain level then I wish to know the time difference between the current cell row time and the current cell -1 row.
The only problem occurs when the time in the current cell is 00:00:17, and the time in the current cell-1 row is 23:55:17.
What I would like to do is paste the formula
'=Mod ((Current cell) -(Current Cell-1),1)'
into another cell, but every time I try to do it I get 'Application-defined or Object-Defined error'
Here is the code I have been using
For x = 4 To 19
y = x + 56
For counter = 3 To C Step 1 'Starts at row 3
Set curcell = Worksheets("All data").Cells(counter, x) ' Starts at Column D
curcell.Select
If curcell >= -30 Then
ActiveCell.Interior.ColorIndex = 3 'Highlights cell red
Z = counter - 1
Cells(counter, y) = "= mod (B" & counter & "-B" & Z & ",1)" 'Subtracts previous time from counter time
End If
Next counter
Next x
Last edited: