else if code

C

choice

i have a code that says
If Range("AL2,AL4,AL6,AL8") >= Range("AP12") The
SubmitAl

ElseIf Range("AL2") > 0.01 The
submitALLcas

Els
M
what i want to happen is if the sum of "AL2,AL4,AL6,AL8 is less then AP12 msgbox to appear, if it is greater then ap12, then SubmitAL
also is everything is greater and AL2 is greater then 0, i want SubmitALLcash to g

please help
 
J

Juan Pablo Gonzalez

Try something like this

If Application.Sum(Range("AL2,AL4,AL6,AL8")) < Range("AP12").Value Then
MsgBox "Your message here"
Else
SubmitAll
If Range("AL2").Value > 0 Tjhen
SubmitAllCash
End If
End If

--
Regards,

Juan Pablo González

choice said:
i have a code that says:
If Range("AL2,AL4,AL6,AL8") >= Range("AP12") Then
SubmitAll

ElseIf Range("AL2") > 0.01 Then
submitALLcash

Else
Ms
what i want to happen is if the sum of "AL2,AL4,AL6,AL8 is less then AP12
msgbox to appear, if it is greater then ap12, then SubmitALL
 
B

Bob Phillips

If Worksheetfunction.Sum(Range("AL2,AL4,AL6,AL8")) < Range("AP12") Then
Msgbox ..........
ElseIf Range("AL2") > 0.01 Then
SubmitALLcash
Else
SubmitAll
End If

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

choice said:
i have a code that says:
If Range("AL2,AL4,AL6,AL8") >= Range("AP12") Then
SubmitAll

ElseIf Range("AL2") > 0.01 Then
submitALLcash

Else
Ms
what i want to happen is if the sum of "AL2,AL4,AL6,AL8 is less then AP12
msgbox to appear, if it is greater then ap12, then SubmitALL
 
Top