excel - How to activate entry-mode with VBA on non-activex textbox inserted to worksheet? -
i manually placed non-activex textbox on worksheet. if assign macro, clicking textbox runs macro expected.
however, entry-mode not enabled on textbox. how can macro put textbox entry-mode?
note, textbox inserted insert ribbon.
thx
i discovered answer shortly before posting above question:
sub activate_textbox() ' stuff before edit mode... ' ... ' textbox name dim sname string sname = application.caller ' textbox shape object dim txtbox shape set txtbox = activesheet.shapes(sname) ' enter edit mode (put cursor textbox) txtbox.textframe2.textrange.select ' cleanup set txtbox = nothing end sub
recommended protect sheet, else you'll see selection handles on textbox when has focus. and, if protect sheet, you'll want unlock text, can type in it:
Comments
Post a Comment