gohan123
06-06-2007, 12:59 PM
Hi,
I,m trying input a value in a cell depend on a value in other cell. But I need to calculated how much time pass from now to that situation and input a information. :banghead:
In this c?digo there is what a need:
Private Sub Classificar_backlog()
Dim i As Variant
Dim Backlog As Variant
Dim resol As Variant
Dim result As Variant
For i = 2 To Cells(Rows.Count, 1).End(xlUp).Row()
'take a value in a cell - this value is a date like 6/06/2007 14:12:55
Backlog = Cells(i, "D").Value
resol = Now()
'this value must be insert like 1,20 or 13,0, etc... in column H
Cells(i, "H").Value = (resol - Backlog)
Select Case Cells(i, "H").Value
Case Is <= 2, 0
Cells(i, "E").Value = "Inicial"
Case Is > 2, 0 >= 4, 0 'if between 2,0 and 4,0
Cells(i, "E").Value = "Meio"
Case Is < 4, 0
Cells(i, "E").Value = "Fim"
End Select
Next i
End Sub
Somebody help me, please....
Tks,
Gohan
Edited 8-Jun-07 by geekgirlau. Reason: insert line breaks
I,m trying input a value in a cell depend on a value in other cell. But I need to calculated how much time pass from now to that situation and input a information. :banghead:
In this c?digo there is what a need:
Private Sub Classificar_backlog()
Dim i As Variant
Dim Backlog As Variant
Dim resol As Variant
Dim result As Variant
For i = 2 To Cells(Rows.Count, 1).End(xlUp).Row()
'take a value in a cell - this value is a date like 6/06/2007 14:12:55
Backlog = Cells(i, "D").Value
resol = Now()
'this value must be insert like 1,20 or 13,0, etc... in column H
Cells(i, "H").Value = (resol - Backlog)
Select Case Cells(i, "H").Value
Case Is <= 2, 0
Cells(i, "E").Value = "Inicial"
Case Is > 2, 0 >= 4, 0 'if between 2,0 and 4,0
Cells(i, "E").Value = "Meio"
Case Is < 4, 0
Cells(i, "E").Value = "Fim"
End Select
Next i
End Sub
Somebody help me, please....
Tks,
Gohan
Edited 8-Jun-07 by geekgirlau. Reason: insert line breaks