PDA

View Full Version : [SOLVED:] Between dates in vba



choubix
06-09-2008, 07:36 PM
hello,

In a sub I have the following code:


For Each rCl In wsStart.Range("G1:G" & _
wsStart.Range("G" & Rows.count).End(xlUp).Row)
If rCl.Value = Date + 5 Then


the sub only looks at data that is 5 days after today.
actually it would be better for me to look at data from today to the next 5 days.

can someone tell me how to handle this case please??

thx

david000
06-09-2008, 10:31 PM
For Each rCl In wsStart.Range("G1:G" & _
wsStart.Range("G" & Rows.count).End(xlUp).Row)
If rCl.Value <= Date + 5 Then

Ago
06-09-2008, 10:52 PM
For Each rCl In wsStart.Range("G1:G" & _
wsStart.Range("G" & Rows.count).End(xlUp).Row)
If rCl.Value => Date And rCl.Value <= Date+5 Then

choubix
06-10-2008, 12:46 AM
thx! works like a charm!

mdmackillop
06-10-2008, 02:39 AM
Don't forget to mark your questions Solved.