Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

clear a textbox with vba - getting 424 object required error

Tags:

excel

vba

i am trying to clear a textbox called "text box 2"

i have tried the following:

TextBox2.Value = ""

^ gets a 424 object required error

TextBox2.Text = ""

^ gets a 424 object required error

Worksheets("Proposal").Textbox2.Value = ""

^ gets a runtime error 438, object doesnt support this property or method

Worksheets("Proposal").Textbox2.Text = ""

^ gets a runtime error 438, object doesnt support this property or method

like image 969
alilland Avatar asked Nov 22 '25 05:11

alilland


1 Answers

Since it is a form control:

Worksheets("Proposal").Shapes("Text Box 2").Value = ""

And since you changed it to an ActiveX control:

Worksheets("Proposal").TextBox2.Value = "" 'This assumes that your newly created text box is still "TextBox2"
like image 197
Kyle Avatar answered Nov 24 '25 23:11

Kyle



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!