ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Format function with international numbers (https://www.excelbanter.com/excel-programming/385484-format-function-international-numbers.html)

Alex St-Pierre

Format function with international numbers
 
Hi,
I have an excel program which generate a word report in french or english.
The program request that the regional settings must be set to the language of
the report English (Canada) or French (Canada). I would like to avoid the
modification of the regional settings. I tried the following:
Sub Macro1()
Dim sValue as String
sValue = Format(2500000, "#,##0")
End Sub
This always gives 2 500 000 when the regional setting is French(Canada). I'm
wondering if there's a way to modify the format function to show 2,500,000
when the report is created in english ?
Thanks!
Alex

--
Alex St-Pierre

JLGWhiz

Format function with international numbers
 
I have not tried it, but I would guess that if the international setting is
English, you could use default to get 2,500,000.

"Alex St-Pierre" wrote:

Hi,
I have an excel program which generate a word report in french or english.
The program request that the regional settings must be set to the language of
the report English (Canada) or French (Canada). I would like to avoid the
modification of the regional settings. I tried the following:
Sub Macro1()
Dim sValue as String
sValue = Format(2500000, "#,##0")
End Sub
This always gives 2 500 000 when the regional setting is French(Canada). I'm
wondering if there's a way to modify the format function to show 2,500,000
when the report is created in english ?
Thanks!
Alex

--
Alex St-Pierre


Tom Ogilvy

Format function with international numbers
 
Stephen Bullen has the chapter of his book that deals with international
issues available on his web site. Take a look:

http://www.oaltd.co.uk/ExcelProgRef/ch22/

--
Regards,
Tom Ogilvy


"Alex St-Pierre" wrote in message
...
Hi,
I have an excel program which generate a word report in french or english.
The program request that the regional settings must be set to the language
of
the report English (Canada) or French (Canada). I would like to avoid the
modification of the regional settings. I tried the following:
Sub Macro1()
Dim sValue as String
sValue = Format(2500000, "#,##0")
End Sub
This always gives 2 500 000 when the regional setting is French(Canada).
I'm
wondering if there's a way to modify the format function to show 2,500,000
when the report is created in english ?
Thanks!
Alex

--
Alex St-Pierre





All times are GMT +1. The time now is 12:11 PM.

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