Selecting multiple dropdown boxes indicated by options in an Excel UserForm using VBA -
this question "part 3" of project i'm working on. after adding multiple labels , textboxes excel userform during runtime using vba , retrieving data multiple textboxes created during runtime in excel userform using vba, i'm trying use data select names in dropdown boxes assign work to.
the issue i'm having is, have code set loop through myarray(i) lbound ubound gives names of employees, this, looping through array created splitting multflnamt retrieved userform can determine how many flns each employee receive, loops through find name of current employee selected assign to. once of done , has correct amount of flns assigned, click submit button in application finish assignment.
' shows , hides multiple option userform multipleoptionform.show multipleoptionform.hide ' creates array comma-delimited ' list of numbers stored in variable mfa = split(multflnamt, ",") ' activates application assigning work wshell.appactivate "non-keyable document management system" ' table cell node dropdown located tdnode = 64 = 1 ' loop through each of names within array c = lbound(myarray) + 1 ubound(myarray) - 1 ' loop through array see how many flns each person receives b = 1 mfa(a) ' loop through locate current name of employee = 0 each objoption in objie.document.getelementsbytagname("table")(0).getelementsbytagname("td")(tdnode).getelementsbyclassname("txt_input1")(0).options q(i) = objoption.text & "-" & objoption.value strwq = q(i) ' remove "selected user" list of options if = 0 if strwq = "--select user---" strwq = "" else ' if option matches current name selected, ' select option, increase node location ' next dropdown box if instr(strwq, myarray(c)) objoption.selected = true objie.document.getelementsbytagname("table")(0).getelementsbytagname("td")(tdnode).getelementsbyclassname("txt_input1")(0).onchange tdnode = tdnode + 23 else objoption.selected = false end if end if next = + 1 next next objie.document.all.item("btn_submit1").click while code working part, it's failing is, if mfa(a) 2 or more, first dropdown selected. put code in debugging mode , i'm not seeing why 2 or more not being selected. ideas?

Comments
Post a Comment