[mso] Excel VBA IF Statement

  • From: "McDonald, Christine, Ms, DCAA" <Christine.McDonald@xxxxxxxx>
  • To: <mso@xxxxxxxxxxxxx>
  • Date: Mon, 26 Sep 2005 15:11:14 -0500

Does an if statement stop, once it meets a true criteria?
 
I'm trying to set up a routine that using today's date, checks to see
which payperiod the date falls in.  
 
So what I wrote was
 
Dim dtppedate as Date
Dim ieac as Integer
 
If today < 10 / 1 / 2005 Then
    dtppedate = ActiveWorkbook.Worksheets("Sum EAC 2006").Range("PP1")
    ieac = ActiveWorkbook.Worksheets("Sum EAC 2006").Range("EACPP1")
Else
if today < 10/15/2005 then
 
    dtppedate = ActiveWorkbook.Worksheets("Sum EAC 2006").Range("PP2")
    ieac = ActiveWorkbook.Worksheets("Sum EAC 2006").Range("EACPP2")
End If
This would continue for 27 payperiods.
 
Will this work for instance if the date is 9/30/2005, then it meets the
first if statement, so does it stop processing the if statement?
 
Or do I somhow get the date to check if it's between two dates?
and
Is there an easier way that writing 27 if statements?
 
Thanks,
 

Christine McDonald, CPA
Technical Specialist
Information Technology Division (RSA-4)
Western Regional Office


 


*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or 
MicrosoftOffice@xxxxxxxxxxxxxxxx

To send mail to the group, simply address it to mso@xxxxxxxxxxxxx

To Unsubscribe from this group, send an email to 
mso-request@xxxxxxxxxxxxx with the word "unsubscribe" (without the quotes) in 
the subject line.

Or, visit the group's homepage and use the dropdown menu.  This will also allow 
you to change your email settings to digest or vacation (no mail).
//www.freelists.org/webpage/mso

To be able to use the files section for sharing files with the group, send a 
request to mso-moderators@xxxxxxxxxxxxx and you will be sent an invitation with 
instructions.  Once you are a member of the files group, you can go here to 
upload/download files:
http://www.smartgroups.com/vault/msofiles
*************************************************************

Other related posts:

  • » [mso] Excel VBA IF Statement