ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Strange format problem with textbox (https://www.excelbanter.com/excel-programming/372862-strange-format-problem-textbox.html)

[email protected]

Strange format problem with textbox
 
I've found a strange format problem when I enter a value in a textbox
on a form.

If I enter value 5,5 in the textbox on the form, it is saved as value
5,5 in cell L14.
If I enter value 5.5 in the textbox on the form, it is saved as value
5,5 in cell L14.

The problem is that I can use the value in L14 in a sum function in the
second alternative, not in the first, although it looks like they are
saved as 5,5 in both cases.

This application is going to be used by people all over the world with
both decimal and dot separators so I have to find a generic solution
for both.

Can anyone help me with a solution?

// S


Bob Phillips

Strange format problem with textbox
 
I don't have my system setup with comma as the decimal separator but I tried
to do it the other way and couldn't.

Couple of questions.

Are you seeing a number or text in that cell?

Can you post your code that does it?

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

wrote in message
oups.com...
I've found a strange format problem when I enter a value in a textbox
on a form.

If I enter value 5,5 in the textbox on the form, it is saved as value
5,5 in cell L14.
If I enter value 5.5 in the textbox on the form, it is saved as value
5,5 in cell L14.

The problem is that I can use the value in L14 in a sum function in the
second alternative, not in the first, although it looks like they are
saved as 5,5 in both cases.

This application is going to be used by people all over the world with
both decimal and dot separators so I have to find a generic solution
for both.

Can anyone help me with a solution?

// S




Carlo

Strange format problem with textbox
 
Hi S

Just a suggestion:
why don't you replace any , with a . before you
save the value to the cell?

Hth

Carlo

" wrote:

I've found a strange format problem when I enter a value in a textbox
on a form.

If I enter value 5,5 in the textbox on the form, it is saved as value
5,5 in cell L14.
If I enter value 5.5 in the textbox on the form, it is saved as value
5,5 in cell L14.

The problem is that I can use the value in L14 in a sum function in the
second alternative, not in the first, although it looks like they are
saved as 5,5 in both cases.

This application is going to be used by people all over the world with
both decimal and dot separators so I have to find a generic solution
for both.

Can anyone help me with a solution?

// S



[email protected]

Strange format problem with textbox
 
Hello,

I'm using this code and I see the number:

Range("O" & (lngSelectedObjective + 14)).Value = txtValue.Text

Can I really trust that it will work on all machines with . if I
replace it?

// S


Carlo skrev:

Hi S

Just a suggestion:
why don't you replace any , with a . before you
save the value to the cell?

Hth

Carlo

" wrote:

I've found a strange format problem when I enter a value in a textbox
on a form.

If I enter value 5,5 in the textbox on the form, it is saved as value
5,5 in cell L14.
If I enter value 5.5 in the textbox on the form, it is saved as value
5,5 in cell L14.

The problem is that I can use the value in L14 in a sum function in the
second alternative, not in the first, although it looks like they are
saved as 5,5 in both cases.

This application is going to be used by people all over the world with
both decimal and dot separators so I have to find a generic solution
for both.

Can anyone help me with a solution?

// S





All times are GMT +1. The time now is 01:26 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com