Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Decimal point

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Decimal point

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.
  #3   Report Post  
Posted to microsoft.public.excel.programming
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.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Decimal point

Hi Flemming, you can set your system by clicking ToolsOptionInternational
and then choose the type of separator you want to use. However, when you
interface with other systems, you will need to know what they are using or it
could cause problems between the two.

"Flemming Jørgensen" 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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Decimal point

Foe some reason I dont have option "International" on that menu.
I'm using VB 6.5 - i dont know if thats the reason.
But thanks anyway


"JLGWhiz" wrote:

Hi Flemming, you can set your system by clicking ToolsOptionInternational
and then choose the type of separator you want to use. However, when you
interface with other systems, you will need to know what they are using or it
could cause problems between the two.

"Flemming Jørgensen" 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



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Decimal point

JLGWhiz's suggestion is for the Tools item in the Excel worksheet's menu
bar, not the one in the VB editor.

Rick


"Flemming Jørgensen" wrote in
message ...
Foe some reason I dont have option "International" on that menu.
I'm using VB 6.5 - i dont know if thats the reason.
But thanks anyway


"JLGWhiz" wrote:

Hi Flemming, you can set your system by clicking
ToolsOptionInternational
and then choose the type of separator you want to use. However, when you
interface with other systems, you will need to know what they are using
or it
could cause problems between the two.

"Flemming Jørgensen" 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


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Decimal point


I have looked for it in excel (2007) - but I couldn't find it.
I seach help for international and found:
MsgBox "The decimal separator is " & _
Application.International(xlDecimalSeparator)

and putting that into the program it showed "," comma
So im lost.

"Rick Rothstein (MVP - VB)" wrote:

JLGWhiz's suggestion is for the Tools item in the Excel worksheet's menu
bar, not the one in the VB editor.

Rick


"Flemming Jørgensen" wrote in
message ...
Foe some reason I dont have option "International" on that menu.
I'm using VB 6.5 - i dont know if thats the reason.
But thanks anyway


"JLGWhiz" wrote:

Hi Flemming, you can set your system by clicking
ToolsOptionInternational
and then choose the type of separator you want to use. However, when you
interface with other systems, you will need to know what they are using
or it
could cause problems between the two.

"Flemming Jørgensen" 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



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Decimal point

When did you tell us you were using Excel 2007? I think you'll find the
majority of Excel users have not moved up to XL2007, so most of the answers
here lean to the prior versions. For future questions you may post, it would
be a good idea to include that fact that you are using XL2007 so that those
able to answer your question as it relates to that version will be alerted.

As to JLGWhiz's suggestion (which I don't know if it will solve your problem
or not), you will find that option by clicking on the Office Button and then
on Excel Options, select the Advanced item from the left-hand listing an
look to the lower part of the Editing Options section in the dialog area on
the right side. Uncheck the "Use system separators" checkbox and enter the
appropriate separators in the indicated textboxes.

Rick


"Flemming Jørgensen" wrote in
message ...

I have looked for it in excel (2007) - but I couldn't find it.
I seach help for international and found:
MsgBox "The decimal separator is " & _
Application.International(xlDecimalSeparator)

and putting that into the program it showed "," comma
So im lost.

"Rick Rothstein (MVP - VB)" wrote:

JLGWhiz's suggestion is for the Tools item in the Excel worksheet's menu
bar, not the one in the VB editor.

Rick


"Flemming Jørgensen" wrote
in
message ...
Foe some reason I dont have option "International" on that menu.
I'm using VB 6.5 - i dont know if thats the reason.
But thanks anyway


"JLGWhiz" wrote:

Hi Flemming, you can set your system by clicking
ToolsOptionInternational
and then choose the type of separator you want to use. However, when
you
interface with other systems, you will need to know what they are
using
or it
could cause problems between the two.

"Flemming Jørgensen" 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




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Decimal point Jock Excel Discussion (Misc queries) 4 May 4th 07 02:02 PM
Converting 2-place decimal value to floating point decimal number with leading zero Kermit Piper Excel Discussion (Misc queries) 3 March 18th 06 06:20 PM
decimal point Diana Excel Worksheet Functions 1 November 30th 05 09:11 PM
FIXED 2 DECIMAL PLACES, MUST ENTER ALL ZEROES AFTER DECIMAL POINT. SUKYKITTY Excel Discussion (Misc queries) 3 July 6th 05 01:50 PM
Why am I getting .+ when I hit the decimal point? ato_dad Excel Discussion (Misc queries) 1 May 31st 05 06:52 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"