user1423997
user1423997

Reputation: 111

ActiveX Text Box Control Text on Excel Worksheet

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

Upvotes: 7

Views: 37111

Answers (1)

chuff
chuff

Reputation: 5866

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.

Upvotes: 18

Related Questions