excel vba - Using VBA: Assign value to label control on userform -


i working in vba code behind userform. have string variable named block corresponds name of text label on userform. after looking @ other questions seems using controls function gives ability control settings of label on userform. block variable string of labels name.i error @ attempts below

 me.controls(block).backcolor = &hffff& 

when try hard code make sure exact name of label still error

 me.controls("s111").backcolor = &hffff& 

the following line work:

 me.s111.backcolor = &hffff& 

when try similar technique error with:

me.block.backcolor = &hffff& 

what doing wrong , doing possible?

the control me.s111 object.

dim objobject object '(not type string) set objobject = me.s111 objobject.backcolor = &hffff& 

Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -