vba - Checking for condition before continuing on a form -
i using excel 2011 mac. have userform contains 3 combo boxes. data in combo boxes populated information spreadsheet. initialization populates combo boxes. have button initiates processing of data. in first step of process, check user has not inadvertently pressed button:
if (cmbstage.text = "") or cmblowdt.value = "" or cmbhighdt.value = "" msgbox "you not ready begin processing!", vbokonly cmbstage.text = "" cmblowdt.value = "" cmbhighdt.value = "" else end if
this checks if users hasn't filled in anything. problem if add goto command , have check start again, since called function button click, loop through message again , again.
what want check condition, if exists, have user start on if had not pushed button. essential part of process comes after lengthy processing point.
if cannot put full screen message says: " complete idiot , should not allowed anywhere near computer balance of natural life" ,vbokayonly
since button triggers new process, why not let if statement gateway the rest of code?
sub buttonpress() if (cmbstage.text = "") or cmblowdt.value = "" or cmbhighdt.value = "" msgbox "you not ready begin processing!", vbokonly cmbstage.text = "" cmblowdt.value = "" cmbhighdt.value = "" end else 'continue task end if end sub
or if can't end ....
sub buttonpress() if (cmbstage.text = "") or cmblowdt.value = "" or cmbhighdt.value = "" msgbox "you not ready begin processing!", vbokonly set yourform = anewinstanceoftheform cmbstage.text = "" cmblowdt.value = "" cmbhighdt.value = "" else 'continue task end if end sub
Comments
Post a Comment