View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
pmguerra[_16_] pmguerra[_16_] is offline
external usenet poster
 
Posts: 1
Default Textbox calculation problem...


It still doesn't work...

So that there is no doubt, I want "dot" do be the decimal separator and
I don't want any thousands separator. Even if I did, it would a "space"
character...

This is getting on my nerves...


Duncan Wrote:
Found it.

it is because of using commas. if you want it to work with commas
where
the dots are supposed to be then put this code first which will
replace
the commas for dots for the purposes of calculating.

s1 = textbox1.Text
s1 = Replace(s1, ",", ".")

But that depends on how big a number you want in the textbox and
whether you need to comma delimit thousands or millions.

For instance

6,000,000.01 should be typed in as 6000000.01


Duncan


pmguerra wrote:

Hi again...

I have a little textbox problem. The code (simplified) is the
following:

Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)

'divide the textbox value by 3
TextBox1.Value = TextBox1.Value / 3

End Sub

when I insert "55", I get 18.333. No problem here.

If I insert "55.55", I get 1851.6667!!!!!!!!!!!!!!! I believe this is

a
dot or comma related problem...

Any help, please???


--
pmguerra

------------------------------------------------------------------------
pmguerra's Profile:

http://www.excelforum.com/member.php...o&userid=14986
View this thread:

http://www.excelforum.com/showthread...hreadid=561409



--
pmguerra
------------------------------------------------------------------------
pmguerra's Profile: http://www.excelforum.com/member.php...o&userid=14986
View this thread: http://www.excelforum.com/showthread...hreadid=561409