# Get Off Formula in beforehand

• July 4th, 2019, 04:38 AM
Sam85
Get Off Formula in beforehand
Hey Peoples,

I got a short Question. I am using this Code but if the first Formula is true it steps one to next one. Can I get off in beforehand? (Like Exit Sub in VBA) :confused:
Or must I nest the If Clauses?

Code:

```    Dim HMV(), KST() as String     Dim LKZ() as Number         HMV = Array("0440010", _                     "1940013", _                     "5045011", "5045012")         LKZ = Array(8, 9)         KST = Array("105313145", "185313145")         If SelectPosition({AUFDRUP_TXT.HiMi-IDNr}, "00", {AUFDRUP_TXT.REZANT}, 100, Count({AUFDRUP_TXT.POSNUM})) Then Formula = True     If Not AreCriteriaTrue( _                             IsCriteriaTrue(2, 0, 0, HMV, {@strHilfsmittel_Nummer (oP)}, 7), _                             IsCriteriaTrue(1, LKZ, {@strHilfsmittel_LKZ}, "", "", 0), _                             IsCriteriaTrue(2, 0, 0, KST, {AUFDRUK_TXT.K-IKNUM}, 0), _                             True) Then Formula = True```
• July 4th, 2019, 12:41 PM
VictorN
Re: Get Off Formula in beforehand
Why not using IF THEN ELSE construction?
• July 5th, 2019, 02:20 AM
Sam85
Re: Get Off Formula in beforehand
Yes, that's what I'm supposed to do (Nest the If Clause like I said in my first post). My question was, if there is an other possibilty instead of nesting, like "Exit Formula" or "Exit Sub".
I just know "Exit For" (requires a For Loop) or "Exit Do" (requires a Do Loop). If there isn't any other way, I am fine with that :). Thanks for your Reply and have a nice weekend.
• July 5th, 2019, 03:19 AM
VictorN
Re: Get Off Formula in beforehand