vba excel,如何重命名用户窗体上的文本框

vba excel, How to rename TextBoxes on userform

我在用户窗体上创建了 112 个文本框。 请帮助通过宏重命名它们。

-TextBox21 - TextBox43 ==> aTextBox21 - aTextBox43
-TextBox44 - TextBox66 ==> bTextBox21 - bTextBox43
-TextBox67 - TextBox89 ==> cTextBox21 - cTextBox43
-TextBox90 - TextBox112 ==> dTextBox21 - dTextBox43

这需要在信任中心选项中为 "Microsoft Visual Basic For Applications Extensibility 5.3" 和 "Trust access to the Visual Basic Project" 设置一个 VBProject 引用集。

Dim f

Set f = Application.VBE.ActiveVBProject.VBComponents("UserForm1")

f.Designer.Controls("TextBox1").Name = "blah"