Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Transferring Data from Code to a Textbox in the Form

I have a value collected from a code and have cell assignment.

Dim SMPL as String

Range "A1" = String

I started to create a form and textbox along with the common OK and cancel
button, but is there a simple way to pass a string value to a form?

When I ran the code and initialized the form the text box would show
Me.Change1.Value=(SMPL).

*** From a Form ***

Private Sub Change1Text_Change()

Me.Change1.Value = (SMPL)

End Sub

My intention is to create a checkbox next to the texbox. If the checkbox =
true then the string will be placed in the cell. If the checkbox = false,
then the string will be null and not printed.

The reason I am asking this because at times, the "user" will need to have
the option to select all or portions of the data collected.

Thank you,

Tom
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Transferring Data from Code to a Textbox in the Form

Assumiong that SMPL is the variable in the basic code. If your code to
assign the value is in the UserForm code module somewhe

Me.TextBox1.Value = SMPL

If you want to assign the value from another code module, you would have to
make the UserForm run modeless or hide it so that the othe code would ruin.
And you would have to specifically use the UserForm name instead of Me.

"TomP" wrote:

I have a value collected from a code and have cell assignment.

Dim SMPL as String

Range "A1" = String

I started to create a form and textbox along with the common OK and cancel
button, but is there a simple way to pass a string value to a form?

When I ran the code and initialized the form the text box would show
Me.Change1.Value=(SMPL).

*** From a Form ***

Private Sub Change1Text_Change()

Me.Change1.Value = (SMPL)

End Sub

My intention is to create a checkbox next to the texbox. If the checkbox =
true then the string will be placed in the cell. If the checkbox = false,
then the string will be null and not printed.

The reason I am asking this because at times, the "user" will need to have
the option to select all or portions of the data collected.

Thank you,

Tom

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Transferring Data from Code to a Textbox in the Form

I initialized the form at the beginning of the module and hide to give it a
chance to find a value. I entered the the code as shown in your example and
when the form appears, no text will appear on the textbox. I even made sure
that the variables are public. Is there anything else I need to check for on
the form or properties?

Thank you,



"JLGWhiz" wrote:

Assumiong that SMPL is the variable in the basic code. If your code to
assign the value is in the UserForm code module somewhe

Me.TextBox1.Value = SMPL

If you want to assign the value from another code module, you would have to
make the UserForm run modeless or hide it so that the othe code would ruin.
And you would have to specifically use the UserForm name instead of Me.

"TomP" wrote:

I have a value collected from a code and have cell assignment.

Dim SMPL as String

Range "A1" = String

I started to create a form and textbox along with the common OK and cancel
button, but is there a simple way to pass a string value to a form?

When I ran the code and initialized the form the text box would show
Me.Change1.Value=(SMPL).

*** From a Form ***

Private Sub Change1Text_Change()

Me.Change1.Value = (SMPL)

End Sub

My intention is to create a checkbox next to the texbox. If the checkbox =
true then the string will be placed in the cell. If the checkbox = false,
then the string will be null and not printed.

The reason I am asking this because at times, the "user" will need to have
the option to select all or portions of the data collected.

Thank you,

Tom

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Transferring Data from Code to a Textbox in the Form

P.S. SMPL would have to be a public variable to be used between modules.

"TomP" wrote:

I have a value collected from a code and have cell assignment.

Dim SMPL as String

Range "A1" = String

I started to create a form and textbox along with the common OK and cancel
button, but is there a simple way to pass a string value to a form?

When I ran the code and initialized the form the text box would show
Me.Change1.Value=(SMPL).

*** From a Form ***

Private Sub Change1Text_Change()

Me.Change1.Value = (SMPL)

End Sub

My intention is to create a checkbox next to the texbox. If the checkbox =
true then the string will be placed in the cell. If the checkbox = false,
then the string will be null and not printed.

The reason I am asking this because at times, the "user" will need to have
the option to select all or portions of the data collected.

Thank you,

Tom

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Transferring Data from Code to a Textbox in the Form

Thank you for your help! I got it to work...

Tom

"JLGWhiz" wrote:

P.S. SMPL would have to be a public variable to be used between modules.

"TomP" wrote:

I have a value collected from a code and have cell assignment.

Dim SMPL as String

Range "A1" = String

I started to create a form and textbox along with the common OK and cancel
button, but is there a simple way to pass a string value to a form?

When I ran the code and initialized the form the text box would show
Me.Change1.Value=(SMPL).

*** From a Form ***

Private Sub Change1Text_Change()

Me.Change1.Value = (SMPL)

End Sub

My intention is to create a checkbox next to the texbox. If the checkbox =
true then the string will be placed in the cell. If the checkbox = false,
then the string will be null and not printed.

The reason I am asking this because at times, the "user" will need to have
the option to select all or portions of the data collected.

Thank you,

Tom



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Transferring from one form to another Helpme Excel Discussion (Misc queries) 8 October 9th 08 12:03 AM
Transferring Control From VBA Form to Spreadsheet Tony LeGrand Excel Programming 2 November 10th 06 02:33 PM
macro that takes data entered in a user form textbox to go to a ra BrianMo Excel Programming 5 September 22nd 06 03:52 PM
Transferring information from one user form to another [email protected] Excel Programming 1 August 17th 06 11:51 PM
Transferring information from textbox to new spreadsheet/document bjames1001 Excel Programming 1 April 26th 05 09:08 PM


All times are GMT +1. The time now is 01:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"