Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Help,
How can I assign a value to a textbox on a userform without looping through all the textboxes. Is it possible to assign the name of the textbox to a string and use that string to immediately assign a value to the textbox with that name? Example: dim sMo as string dim sCapExp as string dim sTxb as string sMo="Jun" sCapExp="Cap" sTxb="txb" & sMO & sCapExp Is there something like the Sheets object where you can place the name in parenthesis, i.e. sheets("Summary"). can you do, Textbox(sTxb).Value = "it works"? Please let me know, |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You can name the textbox by changing the (name) property while you're designing
the userform. Inside the VBE hit ctrl-r (to see the properties window) Show the userform select the textbox change that (name) property to something you like. Then you can use: me.controls("myspecialnamehere").text = "sometext here" or with your variables: me.controls(Txb).text = "sometext here" Dennis wrote: Help, How can I assign a value to a textbox on a userform without looping through all the textboxes. Is it possible to assign the name of the textbox to a string and use that string to immediately assign a value to the textbox with that name? Example: dim sMo as string dim sCapExp as string dim sTxb as string sMo="Jun" sCapExp="Cap" sTxb="txb" & sMO & sCapExp Is there something like the Sheets object where you can place the name in parenthesis, i.e. sheets("Summary"). can you do, Textbox(sTxb).Value = "it works"? Please let me know, -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dave,
Thank you so much, this worked perfectly! "Dennis" wrote: Help, How can I assign a value to a textbox on a userform without looping through all the textboxes. Is it possible to assign the name of the textbox to a string and use that string to immediately assign a value to the textbox with that name? Example: dim sMo as string dim sCapExp as string dim sTxb as string sMo="Jun" sCapExp="Cap" sTxb="txb" & sMO & sCapExp Is there something like the Sheets object where you can place the name in parenthesis, i.e. sheets("Summary"). can you do, Textbox(sTxb).Value = "it works"? Please let me know, |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Concatinate name and date | Excel Discussion (Misc queries) | |||
Concatinate Formatting | Excel Discussion (Misc queries) | |||
concatinate data | Excel Worksheet Functions | |||
concatinate and vlookup | Excel Programming | |||
Concatinate a filename | Excel Discussion (Misc queries) |