forms - Mouseover created object (vba) -
well, i'm not pro in programming, i've been working on vba code awhile, , @ time i've put label objects 'manually' on form, calling me.controls.add function, setting new label config (autosize, width, pos etc...), caption assigned value of cell activeworkbook.
ok until that. i'd use mousemove effect on these new created labels, , couldn't.
one more thing: userform, let's call userform x, initializes first userform y window, in y userform click on button load , show userform x.
so userform x creates labels when initializing, before showing up.
i presume there's way 'reload' eighter 'refresh' userform x , understand created labels had been there , i'd able mousemove on them. how?
here part of code:
private sub userform_initialize() on error resume next c = 0 'counting labels name 'open source workbook if not isworkbookopen.isworkbookopen("book.xlsm") application.workbooks.open "book.xlsm", , true end if workbooks("book.xlsm").sheets(1).activate activesheet.range("a1").activate 'do addlabel while activecell.value <> "" if activecell.value <> "price" addlabel c = c + 1 end if activecell.offset(0, 1).activate loop 'close source workbook workbooks("badges.xlsm").close false end sub private sub addlabel() dim thelabel object set thelabel = me.controls.add("forms.label.1", "procedimentos_label" & c + 1, true) thelabel .autosize = true .caption = activecell.value .left = 10 .width = 100 .top = 100 + 20 * c end end sub
Comments
Post a Comment