alexandro88
11-01-2011, 10:50 PM
Hi All,
I want to identify the date within which range week.
However, I can't get the actual output.
LValue = 2-Nov-11
Actual sheet:
Column A Column B Column H
29-Oct-11 5-Nov-11
5-Nov-11 12-Nov-11
After run the code i will get :
Column A Column B Column H
29-Oct-11 5-Nov-11 Fail
5-Nov-11 12-Nov-11 Fail
The output i want :
Column A Column B Column H
29-Oct-11 5-Nov-11 Fail
5-Nov-11 12-Nov-11
My code:
Option Explicit
Sub ASM006()
Dim rngcell As Range
Dim LValue As String
LValue = Format(Date, "d - mmm - yy")
Worksheets("LW").Activate
For Each rngcell In Range("A3:G3" & Range("A" & Rows.Count).End(xlUp).Row)
If LValue <= Range("A" & rngcell.Row).Value And Range("B" & rngcell.Row).Value >= LValue Then
Range("H" & rngcell.Row).Value = "Fail"
End If
Next
' End of LOOP
End Sub
I want to identify the date within which range week.
However, I can't get the actual output.
LValue = 2-Nov-11
Actual sheet:
Column A Column B Column H
29-Oct-11 5-Nov-11
5-Nov-11 12-Nov-11
After run the code i will get :
Column A Column B Column H
29-Oct-11 5-Nov-11 Fail
5-Nov-11 12-Nov-11 Fail
The output i want :
Column A Column B Column H
29-Oct-11 5-Nov-11 Fail
5-Nov-11 12-Nov-11
My code:
Option Explicit
Sub ASM006()
Dim rngcell As Range
Dim LValue As String
LValue = Format(Date, "d - mmm - yy")
Worksheets("LW").Activate
For Each rngcell In Range("A3:G3" & Range("A" & Rows.Count).End(xlUp).Row)
If LValue <= Range("A" & rngcell.Row).Value And Range("B" & rngcell.Row).Value >= LValue Then
Range("H" & rngcell.Row).Value = "Fail"
End If
Next
' End of LOOP
End Sub