pedie
Well-known Member
- Joined
- Apr 28, 2010
- Messages
- 3,875
If the value [date] is <= x then msgbox "yes" & my statement...
Where 'm i doing it wrong...?
Thanks.
I know there are cells matching critiria however it does not msgbox ....
hey i think it should be...
For myC = lr To 1 Step -1
Where 'm i doing it wrong...?
Thanks.
I know there are cells matching critiria however it does not msgbox ....
Code:
[FONT=Courier New]Option Explicit[/FONT]
[FONT=Courier New]Sub try3()[/FONT]
[FONT=Courier New]Dim x As String[/FONT]
[FONT=Courier New]Dim lr as long, myC As Long 'myC As Range[/FONT]
[FONT=Courier New]x = Date - 90[/FONT]
[FONT=Courier New]lr = Sheet2.Range("A" & Rows.Count).End(xlUp).Row[/FONT]
[FONT=Courier New]For myC = lr To 1 - 1[/FONT]
[FONT=Courier New] If Cells(myC, "D").Value <= x Then[/FONT]
[FONT=Courier New] MsgBox "Yes"[/FONT]
[FONT=Courier New] End If[/FONT]
[FONT=Courier New]Next myC[/FONT]
[FONT=Courier New]End Sub[/FONT]
hey i think it should be...
For myC = lr To 1 Step -1