View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
justzach[_3_] justzach[_3_] is offline
external usenet poster
 
Posts: 1
Default value lessthan x and greaterthan y

my excel file lists files in a certain folder (txt files to be imported
in columnA, lists the dates those files were modified in columnB, an
columnC shows the dates in columnB in general form (ex. 37866). Column
lists when certain reports should be run in general date format. i a
trying to tell VB to make sure the date from columnC is between th
values in two fields in columnF to know if the report should be run
below is the code i have written, but excel still runs the report eve
if i put in dates that not not make the IF statements true, thus shoul
not run the reports. here is a snippet of the code :

Sub Summer2()

Sheets("Extra").Select
If Range("F20") <= Range("C2") <= Range("F23") Then
SummerPasteData
SummerAdminReports
End If

Sheets("Extra").Select
If Range("F21") <= Range("C2") <= Range("F22") Then
SummerStudentReports
End If

End Sub

any ideas? is this not how to tell VB to compare one value ot make sur
it is greaterthan one and less than another? i could not find anythin
in VB help or on this board that would show how to combine compariso
operators such as the one above i am attempting. thanks in advance fo
your help

--
Message posted from http://www.ExcelForum.com