-
Percentages...
I have a text box called Text1 and a combobox called Combo1 and there are 10 items in it as follows and user can also manually enter the whatever they need...they can enter 149% instead of using 150%...
For example...
1
1.25
1.5
1.75
2
100%
125%
150%
175%
200%
now the problem is I need to multiply what ever user enters in combo box with the number in Text box...
For example Text1.Text = 100 and if user chooses 1.5 then the answer will be 150 and if the user choose 150% then the answer will be 150...however if the user chooses 149% then the answer will be 149 and same user can just enter 1.49 to get the answer 149...
I hope that I explained it proper enough to understand...
Cheers...
-
Code:
MsgBox (Text1 * Val(Combo1 )) / 100
-
hmmm...
ThX Khalik but if the user chooses 1.5 in combobox then it just gives 1.5 instead of 150 and the percentage is fine it gives 150...
Basically I need a way to figure if the user has entered a pure number or a number with the % at the end of it...
-
if right(combo1.text,1) = "%" then
MsgBox (Text1 * Val(Combo1 )) / 100
else
MsgBox (Text1 * Val(Combo1 ))
end if