Thread: Decimal point
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Flemming Jørgensen[_2_] Flemming Jørgensen[_2_] is offline
external usenet poster
 
Posts: 8
Default Decimal point

I'm sorry to say that is dosnt work
MsgBox dasheet.Cells(2, 1)

dasheet.Cells(2, 1) = Replace(dasheet.Cells(2, 1).Value, ",", ".")

MsgBox dasheet.Cells(2, 1)

Both Msgbox shows comma - and the program dumps

" wrote:

On 6 Apr, 14:59, Flemming Jørgensen <Flemming
wrote:
Hi

I have a code like this
PrintSheet.Range("L24") = "=" & dasheet.Cells(2, 1) & "*" &
adsheet.Cells(adix, 6) & "/" & adsheet.Cells(40, 6)

and when the user put in like 500,35 in dasheet.Cells(2,1) it creates an
runtime error. The problem dosn't occur when they ttype in 500.35.

But im danish - and in denmark we use "," (comma) as decimal point.

How can I change VB to use "," as decimail point instead of "."

Thanks for any help


Use S=Replace (S, ",". ".") to replace commas with full stops? Excel
is very liberal in letting you treat numbers as text, and generally
accepts them back as numbers.