ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How to xFer via VBA a VBA variable to Form (https://www.excelbanter.com/excel-discussion-misc-queries/117211-how-xfer-via-vba-vba-variable-form.html)

EagleOne

How to xFer via VBA a VBA variable to Form
 
2003

With the Control ToolBox displayed on an "Sheet1," in the Design Mode,
the "Formula Bar" displays =EMBED("Forms.TextBox.1","").

Currently, I have linked TextBox1 to cell M3. Therefore, when I enter
text into M3, it is displayed in the TextBox1.

Yes, I can "populate" TextBox1 in VBA by:

sheets("Sheet1").Range("M3").value = txt ("txt" is a variable in a
VBA procedure)

How can I get the VBA variable directly into TextBox1?

Under properties, I see separate "Text," "Value," and as mentioned
above, LinkedCell dropdowns.

Is there a way to populate TextBox1 directly in VBA? (without using
LinkedCell = M3)?

Like: ActiveSheet.Shapes("TextBox1").Value = "bbb" (if the
Object/Method supported it)


TIA EagleOne


Allllen

How to xFer via VBA a VBA variable to Form
 
ActiveSheet.TextBox1.Text = "bbb"

txt = "bbb"
ActiveSheet.TextBox1.Text = txt

--
Allllen


"EagleOne" wrote:

2003

With the Control ToolBox displayed on an "Sheet1," in the Design Mode,
the "Formula Bar" displays =EMBED("Forms.TextBox.1","").

Currently, I have linked TextBox1 to cell M3. Therefore, when I enter
text into M3, it is displayed in the TextBox1.

Yes, I can "populate" TextBox1 in VBA by:

sheets("Sheet1").Range("M3").value = txt ("txt" is a variable in a
VBA procedure)

How can I get the VBA variable directly into TextBox1?

Under properties, I see separate "Text," "Value," and as mentioned
above, LinkedCell dropdowns.

Is there a way to populate TextBox1 directly in VBA? (without using
LinkedCell = M3)?

Like: ActiveSheet.Shapes("TextBox1").Value = "bbb" (if the
Object/Method supported it)


TIA EagleOne




All times are GMT +1. The time now is 01:14 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com