J
jon
Hi all.
Having trouble with an if statement.
What I am trying to do is as follows
If dateIcyBaan = today's date and it is a Sunday
then ok end
Else if dateIcyBaan = today's date and before 7:30am then
dateIcyBaan = vbadate - 1
Else if dateIcyBaan = today's date and after 7:30am and weekday =
Saturday then
dateIcyBaan = vbadate + 1
The code I am using now is below but at the moment it dose the following
Alters nothing.
without the Sunday if statement the other 2 statements run as required.
If dateIcyBaan = VBA.date() And WeekDay(7) Then
dateIcyBaan = VBA.date
ElseIf dateIcyBaan = VBA.date() And time < #7:30:00 AM# Then
dateIcyBaan = VBA.date - 1
ElseIf dateIcyBaan = VBA.date() And time > #7:30:00 AM# And
WeekDay(7) Then
dateIcyBaan = VBA.date + 1
End If
Thanks
Jon
Having trouble with an if statement.
What I am trying to do is as follows
If dateIcyBaan = today's date and it is a Sunday
then ok end
Else if dateIcyBaan = today's date and before 7:30am then
dateIcyBaan = vbadate - 1
Else if dateIcyBaan = today's date and after 7:30am and weekday =
Saturday then
dateIcyBaan = vbadate + 1
The code I am using now is below but at the moment it dose the following
Alters nothing.
without the Sunday if statement the other 2 statements run as required.
If dateIcyBaan = VBA.date() And WeekDay(7) Then
dateIcyBaan = VBA.date
ElseIf dateIcyBaan = VBA.date() And time < #7:30:00 AM# Then
dateIcyBaan = VBA.date - 1
ElseIf dateIcyBaan = VBA.date() And time > #7:30:00 AM# And
WeekDay(7) Then
dateIcyBaan = VBA.date + 1
End If
Thanks
Jon