vbaccelerator - Compile Eror: Next without for -


i'm trying learn code, , here is:

sub lala() dim ha string dim objcell object dim ha2 string dim ha3 string     each objcell in activesheet     msgbox ("blah")     ha = msgbox("do want same message box?", vbyesno)     if ha = vbyes     next objcell     else     msgbox("do want 1 @ all?", vbyesno) = ha3     if ha3 = vbyes     ha2 = inputbox("what want say?")     else     exit sub     end if     end if end sub 

you mixing "if" , "for", "next" in "if" statement, while should outside it. here "corrected" code :

sub lala()     dim ha string     dim objcell object     dim ha2 string     dim ha3 string     each objcell in activesheet         msgbox ("blah")         ha = msgbox("do want same message box?", vbyesno)         if ha = vbno exit     next objcell     msgbox("do want 1 @ all?", vbyesno) = ha3     if ha3 = vbyes         ha2 = inputbox("what want say?")     else         exit sub     end if end sub 

Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -