for loop - Assigning variables? -
i have looked awhile find answer, see similar codes , try adjust code work. basically, need textboxes on userform
turn red white font based on text received work sheet in 1 of textboxes. know close, don't understand placement of wording!
sub changeclr() dim tbmytextbox textbox dim ufmyuserform userform each tbmytextbox in ufmyuserform if tbaction1 = "tank in spec" tbmytextbox.backcolor = vbgreen tbmytextbox.forecolor = vbblack else tbtextbox.backcolor = vbgreen tbmytextbox.forecolor = vbblack end if next tbmytextbox end sub
now know using vbscript in excel, code loop thru , change text boxes (including action one) based on wording in action text box. can tweak exact specifications.
dim varcontrol control each varcontrol in ufmyuserform.controls if typeof varcontrol msforms.textbox if tbaction1 = "tank in spec" varcontrol.backcolor = vbred varcontrol.forecolor = vbwhite else varcontrol.backcolor = vbgreen varcontrol.forecolor = vbblack end if end if next
Comments
Post a Comment