gibbo1715
04-05-2005, 07:07 AM
Hi All
What im trying to do is use the code below to put a sheet name into a list box if the date in it is between now - 30 and now +7 but it seem to add any date greater than today, any ideas please?
I should add this code is part of a larger case statement
For Each ws In ActiveWorkbook.Worksheets
If ws.Range("C10").Value >= Date - 30 And Range("C10").Value <= Date + 7 Then
ListBox1.AddItem ws.Name
End If
Next
What im trying to do is use the code below to put a sheet name into a list box if the date in it is between now - 30 and now +7 but it seem to add any date greater than today, any ideas please?
I should add this code is part of a larger case statement
For Each ws In ActiveWorkbook.Worksheets
If ws.Range("C10").Value >= Date - 30 And Range("C10").Value <= Date + 7 Then
ListBox1.AddItem ws.Name
End If
Next