Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default text box to variable

I know this is probably simple, but I need to asign the text input into a
text box to a variable after a button click.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default text box to variable

Dim S as String
S = Textbox1.Text

HTH. Best wishes Harald

"BOONER" skrev i melding
...
I know this is probably simple, but I need to asign the text input into a
text box to a variable after a button click.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default text box to variable

Thanks a lot Harald.

"Harald Staff" wrote:

Dim S as String
S = Textbox1.Text

HTH. Best wishes Harald

"BOONER" skrev i melding
...
I know this is probably simple, but I need to asign the text input into a
text box to a variable after a button click.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default text box to variable

What if the text box is in a userform and the variable that needs to be
assigned to the value of the text box is in a macro that is started after a
button click from a button on the same userform as the text box? I hope that
makes sense.

"BOONER" wrote:

I know this is probably simple, but I need to asign the text input into a
text box to a variable after a button click.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default text box to variable

I am getting runtime error 424
Object required

"BOONER" wrote:

What if the text box is in a userform and the variable that needs to be
assigned to the value of the text box is in a macro that is started after a
button click from a button on the same userform as the text box? I hope that
makes sense.

"BOONER" wrote:

I know this is probably simple, but I need to asign the text input into a
text box to a variable after a button click.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default text box to variable

My wife took our crystal ball with her. I'll have to wait for her to return
home, unless you choose to show me your code yourself.

Best wishes Harald

"BOONER" skrev i melding
...
I am getting runtime error 424
Object required



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default text box to variable

Then enter the code suggested by Harald in the same macro that is triggered
by clicking on the button... provided that macro belongs to the form. If it
doesn't, then prefix TextBox1 by UserForm1. (with the dot) (Userform1 is the
name of your form).
--
Stefano Gatto


"BOONER" wrote:

What if the text box is in a userform and the variable that needs to be
assigned to the value of the text box is in a macro that is started after a
button click from a button on the same userform as the text box? I hope that
makes sense.

"BOONER" wrote:

I know this is probably simple, but I need to asign the text input into a
text box to a variable after a button click.

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
Macro - Fixed text code needs replacing with variable text steven.holloway Excel Discussion (Misc queries) 3 July 22nd 08 03:57 PM
Entering Variable Text in Text Boxes...... Steve Jones Excel Discussion (Misc queries) 3 June 14th 07 02:34 PM
Put variable into text ? SpookiePower Excel Programming 1 January 12th 06 03:17 PM
Putting text in a column based on variable text from another colum Jacky D. Excel Discussion (Misc queries) 1 December 16th 04 06:09 PM
check variable(text) with cell (text), textbox Mark[_17_] Excel Programming 1 August 27th 03 01:15 PM


All times are GMT +1. The time now is 08:28 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"