Link to home
Start Free TrialLog in
Avatar of Kimberly Helm
Kimberly Helm

asked on

If... Then... Else with Multiple Actions

Is it possible to create an If...Then...Else statement with multiple actions under "Then" and "Else"?  I currently have the following code:

Dim frstmtgpymnt As Date
Dim lvertn As Boolean

frstmtgpymnt = DateAdd("d", 60, Sheet1.[z1E])

If (cleave1 = True And appleave1 = True And (IsEmpty(Sheet1.[z1DP]) Or Sheet1.[z1DP] > frstmtgpymnt)) Or _
(cleave2 = True And appleave2 = True And (IsEmpty(Sheet1.[z1IU]) Or Sheet1.[z1IU] > frstmtgpymnt)) Or _
(cleave3 = True And appleave3 = True And (IsEmpty(Sheet1.[z1NY]) Or Sheet1.[z1NY] > frstmtgpymnt)) Then _
    lvertn = True
    Sheet5.[A3].EntireRow.Hidden = False
    Sheet5.[A2].EntireRow.Hidden = True
Else
    lvertn = False
    Sheet5.[A3].EntireRow.Hidden = True
    Sheet5.[A2].EntireRow.Hidden = False
End If

Open in new window


I'm getting an Error at Else stating that I can't have an Else without If block (which I do, but perhaps with the wrong syntax).  Thanks in advance for any help.
ASKER CERTIFIED SOLUTION
Avatar of Bill Prew
Bill Prew

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Kimberly Helm
Kimberly Helm

ASKER

Ha! Such a small change.  Thank you, very helpful!
Welcome.


»bp