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.

enter image description here

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:

enter image description here


Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -