baba_excel
New Member
Greetings
Problem: From database student data would be pulled as follows:
09/05/2005 - 10/15/2006 - A
10/15/2006 - 12/31/2006 - O
01/01/2007 - 02/29/2010 - A
03/01/2010 - 12/31/2011 - O
01/01/2012 - F
So the period pulled in excel can be in more than 5 rows and there certain conditions governing it
so if O < 6 then prior A is F and if > 6 then prior A = O (2007 - 2011)
wrote the code but looks like it will not solving the purpose
Sub test()
Dim x As Integer
Range("b2").Select
'Cells(65536, 2).End(xlUp).Select
x = ActiveCell.Row
For i = 2 To x
If Range("c" & i).Value = "O" And Format(Range("b" & i).Value - Range("a" & i).Value, "m") > 6 Then
MsgBox Format(Range("b" & i).Value - Range("a" & i).Value, "m")
End If
Next i
End Sub
knew there are updates but guidance would help
Problem: From database student data would be pulled as follows:
09/05/2005 - 10/15/2006 - A
10/15/2006 - 12/31/2006 - O
01/01/2007 - 02/29/2010 - A
03/01/2010 - 12/31/2011 - O
01/01/2012 - F
So the period pulled in excel can be in more than 5 rows and there certain conditions governing it
so if O < 6 then prior A is F and if > 6 then prior A = O (2007 - 2011)
wrote the code but looks like it will not solving the purpose
Sub test()
Dim x As Integer
Range("b2").Select
'Cells(65536, 2).End(xlUp).Select
x = ActiveCell.Row
For i = 2 To x
If Range("c" & i).Value = "O" And Format(Range("b" & i).Value - Range("a" & i).Value, "m") > 6 Then
MsgBox Format(Range("b" & i).Value - Range("a" & i).Value, "m")
End If
Next i
End Sub
knew there are updates but guidance would help