Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ActiveX Text Box Control Text on Excel Worksheet

Tags:

excel

vba

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

like image 460
user1423997 Avatar asked Jan 31 '13 15:01

user1423997


People also ask

How do I link a textbox to a cell in Excel VBA?

Step 1: Click the Text Box button under Insert tab, and insert a textbox in your worksheet. Step 2: While text box is selected put your cursor in the formula bar, type in = symbol and then click on the cell you want to link to, and finally press the Enter key.


1 Answers

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.

like image 89
chuff Avatar answered Oct 21 '22 04:10

chuff