View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Patrick Molloy[_2_] Patrick Molloy[_2_] is offline
external usenet poster
 
Posts: 1,298
Default IF DATE Statement help please


I'm clear on what it is that you're tryign to achieve.


dim source as range
IF Day(Date)= 1 AND format$(date,"DDD") = "Sun" THEN
set source = Range("A1")
ELSEIF Day(Date)= 1 AND format$(date,"DDD") ="Sat" THEN
set source = Range("A2")
ELSE
set source = Range("A3")
END IF


some might suggest that instead of
format$(date,"DDD")
you could use the WEEKDAY() function. Makes no difference to the logic
either way

"Simon" wrote:

Hi I would like to use the following type of statement (I think
unfortunately my brain is in "Excel not VBA mode"):

IF

Then Else

Or Else

I wish to use the criteria that If date (date = 1st of the month) AND
Day = Sun, =Range("A1")
If Day = Sat AND DATE = 1 = Range("A2")
Else = Range("A3")

Thanks for your help