excel - Programmatically Rename activeX text box "(name)" field -
how can programmatically rename activex text box? i'm referring (name) field in properties window.
activex text boxes can referred existing name or ordinal in shapes collection.
if know text box named textbox1 , want call textbox99 refer directly.
with activesheet '<-reference worksheet properly! .shapes("textbox1").name = "textbox99" end
if want rename of text boxes in worksheet loop through of shapes.
dim t long, s long activesheet '<-reference worksheet properly! s = 1 .shapes.count if cbool(instr(1, .shapes(s).name, "textbox", vbtextcompare)) t = t + 1 .shapes(s).name = "mytextbox" & format(t, "00") end if next s end
note .shapes collection's index one-based, not zero-based. depending on trying accomplish, error control ensure not attempt rename text box exists prudent.
Comments
Post a Comment