Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default Is it possible to send a "variable" to a userform text box?

I have previously sent fixed values to a userform text box but is it
possible to have my code take some user input then feed that user
input to a userform text box during the same run of the code? In
other words my text box could say "Program will run for location xxxx"
where xxxx is the variable that can change with each run of the code?

Thanks,
Chet
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default Is it possible to send a "variable" to a userform text box?

hi
use the inputbox method ie....
dim v as string
v= inputbox("enter something")
textbox1.value = v

since you didn't post any code, i'm not sure just how you would work it in.
look up inputbox in vb help for more info.

Regards
FSt1

"Chet" wrote:

I have previously sent fixed values to a userform text box but is it
possible to have my code take some user input then feed that user
input to a userform text box during the same run of the code? In
other words my text box could say "Program will run for location xxxx"
where xxxx is the variable that can change with each run of the code?

Thanks,
Chet

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default Is it possible to send a "variable" to a userform text box?

On Jan 30, 12:47*pm, FSt1 wrote:
hi
use the inputbox method ie....
dim v as string
v= inputbox("enter something")
textbox1.value = v

since you didn't post any code, i'm not sure just how you would work it in..
look up inputbox in vb help for more info.

Regards
FSt1



"Chet" wrote:
I have previously sent fixed values to a userform text box but is it
possible to have my code take some user input then feed that user
input to a userform text box during the same run of the code? *In
other words my text box could say "Program will run for location xxxx"
where xxxx is the variable that can change with each run of the code?


Thanks,
Chet- Hide quoted text -


- Show quoted text -


A follow-up question if I may. I did what you said and created the
variable to feed the textbox but the variable is not showing up in the
textbox when the form is displayed when I run the code. Possibly i am
doing it in the wrong sequence or section of code. Where should I put
the code you mentioned?

Right now I have this for my "form code" (shown below)... Textbox3 is
the variable that should be feeding the textbox. I actually created
the variable called FormTextToShow in the main vba module that calls
up the form with this code.

FormTextToShow = "Program will run for location " & Location & " for
month of " & MonthAlpha & " " & TargetYear

I made "FormTextToShow" a Public variable in the main module also in
order to pass it to the form code. The problem is I run the main code
and the variable FormTextToShow does not show up. I just get a blank
textbox showing up on my form. (I did do a step-through it test and
ran the code and the FormTextToShow variable did show up then in my
textbox3.)

What am I doing wrong? Thx much... Chet


Private Sub CommandButton1_Click()
TextBox3.Value = FormTextToShow
TextString1 = TextBox3.Text
PrelimStatus = OptionButton1.Value
FinalStatus = OptionButton2.Value
MinMinutesToKeep = TextBox2.Text
FilterOut = CheckBox1.Value
SaveToDesktop2 = OptionButton3.Value
SaveToMyDocs2 = OptionButton7.Value
SaveToFltSched = OptionButton8.Value
SaveToGeneral = OptionButton4.Value
SaveNo = OptionButton6.Value
Unload FltSchedAnalysis
End Sub
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
Trying to move photo behind text. "Send back" doesn't work. Judy Excel Worksheet Functions 5 April 23rd 23 07:45 PM
Excel 2003 giving annoying "Send/Don't Send" error when closing BigDaddyCool Excel Discussion (Misc queries) 0 January 29th 10 02:31 AM
Signature missing when "send to" "mail recipient" Jim Tortorelli Excel Discussion (Misc queries) 2 September 21st 07 05:19 PM
use variable in Workbooks("book1").Worksheets("sheet1").Range("a1" Luc[_3_] Excel Programming 2 September 28th 05 08:37 PM
Recognize text in message box by "Net send" abc[_6_] Excel Programming 0 September 14th 05 08:01 AM


All times are GMT +1. The time now is 09:59 AM.

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

About Us

"It's about Microsoft Excel"