BrianExcel
Well-known Member
- Joined
- Apr 21, 2010
- Messages
- 975
What's the most effective way to go about this?
The user enters a number into a text box and presses a button to search. The number in that text box can be either 2, 3 or 4 digits.
I basically need to do the following:
If len(textbox1) = 1 then
textbox2 = "00" & textbox1.value & "@here.com"
else
if len(textbox1) = 2 then
textbox2 = "0" & textbox1.value & "@here.com"
else
if len(textbox1) = 3 then
textbox2 = textbox1.value & "@here.com"
end if
PS - I know the above code is not accurate. I am missing "End If' and a few other things, but this gives an exmaple of what I am trying to do. Would there be a way to do this? Would Select case be a better example?
Thanks.
The user enters a number into a text box and presses a button to search. The number in that text box can be either 2, 3 or 4 digits.
I basically need to do the following:
If len(textbox1) = 1 then
textbox2 = "00" & textbox1.value & "@here.com"
else
if len(textbox1) = 2 then
textbox2 = "0" & textbox1.value & "@here.com"
else
if len(textbox1) = 3 then
textbox2 = textbox1.value & "@here.com"
end if
PS - I know the above code is not accurate. I am missing "End If' and a few other things, but this gives an exmaple of what I am trying to do. Would there be a way to do this? Would Select case be a better example?
Thanks.