7

In VBA, how do I access the text value of an ActiveX text box control on an Excel worksheet?

2
  • Check out this SO post.
    – chuff
    Jan 31, 2013 at 15:15
  • Thanks chuff. Is there an Excel equivalent of ActiveDocument.TextBox1.Value? Jan 31, 2013 at 15:19

1 Answer 1

18

You can use ActiveSheet.TextBox1.Text to set or get the contents of an ActiveX textbox control.

If you have more than one ActiveX textbox on a page, you can use ActiveSheet.OLEObjects("boxname").Object.Text to set or get its contents. boxname is the name of the box in quotes ; or with no quotes, a string variable to which you have assigned the name of the textbox; or the object number of the box.

See this Microsoft documentation for more information.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.