Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
n.almeida
 
Posts: n/a
Default override locale computer settings

I appreciate any help. This is a problem I posted yesterday probably without
being very clear.

How can I override the Windows Regional settings so that my Excel File looks
the same in a computer in Italy and in the Netherlands without forcing the
user to change the Locale Regional settings?
This affects the Date and the Time format, specially within formulas.

Also it seems that the locale setting on Cell Format only works if the
locale is NOT the default.
i.e. A file with the default in UK Eng. and a cell date in Italian and
another in UK Eng, will have the cell in Italian on a Dutch computer but the
UK one will be turned into Dutch.

Besides, this setting does not work within a cell.
i.e. the formula TEXT(E12,"*yymmdd")&"-Blabla" will look like 050216-Blabla
on a UK Eng, but will look yy0216-Blabla on a Dutch or Italian computer

I appreciate any help. This is a problem posted yesterda
  #2   Report Post  
Jim Rech
 
Posts: n/a
Default

You should avoid like the plague any functions that use region-specific
strings like TEXT. Otherwise you'll have to find a way of determining
dynamically the format codes you need in the region of the user.

One way is with a macro. Just as an example, this macro returns the three
date codes of the current region:

Sub ListDateCode()
Range("A1").Value = Application.International(xlYearCode)
Range("A2").Value = Application.International(xlMonthCode)
Range("A3").Value = Application.International(xlDayCode)
End Sub

Then you could refer to these results like this:
=TEXT(F2,REPT(A2,2)&"."&REPT(A3,2)&"."&REPT(A1,4))

--
Jim Rech
Excel MVP
"n.almeida" wrote in message
...
|I appreciate any help. This is a problem I posted yesterday probably
without
| being very clear.
|
| How can I override the Windows Regional settings so that my Excel File
looks
| the same in a computer in Italy and in the Netherlands without forcing the
| user to change the Locale Regional settings?
| This affects the Date and the Time format, specially within formulas.
|
| Also it seems that the locale setting on Cell Format only works if the
| locale is NOT the default.
| i.e. A file with the default in UK Eng. and a cell date in Italian and
| another in UK Eng, will have the cell in Italian on a Dutch computer but
the
| UK one will be turned into Dutch.
|
| Besides, this setting does not work within a cell.
| i.e. the formula TEXT(E12,"*yymmdd")&"-Blabla" will look like
050216-Blabla
| on a UK Eng, but will look yy0216-Blabla on a Dutch or Italian computer
|
| I appreciate any help. This is a problem posted yesterda


  #3   Report Post  
n.almeida
 
Posts: n/a
Default

Hi Jim
Thanks for your answer.
Unfortunately I am not familiar with macros. I would appreciate if you could
direct me a bit on this.
However, from your answer I think you misunderstood (or I misunderstood your
reply): I do not want to have the the format of the region of the user, quite
the opposite I want to override them in order to have the same format
independently of the region odf the user.

"Jim Rech" wrote:

You should avoid like the plague any functions that use region-specific
strings like TEXT. Otherwise you'll have to find a way of determining
dynamically the format codes you need in the region of the user.

One way is with a macro. Just as an example, this macro returns the three
date codes of the current region:

Sub ListDateCode()
Range("A1").Value = Application.International(xlYearCode)
Range("A2").Value = Application.International(xlMonthCode)
Range("A3").Value = Application.International(xlDayCode)
End Sub

Then you could refer to these results like this:
=TEXT(F2,REPT(A2,2)&"."&REPT(A3,2)&"."&REPT(A1,4))

--
Jim Rech
Excel MVP
"n.almeida" wrote in message
...
|I appreciate any help. This is a problem I posted yesterday probably
without
| being very clear.
|
| How can I override the Windows Regional settings so that my Excel File
looks
| the same in a computer in Italy and in the Netherlands without forcing the
| user to change the Locale Regional settings?
| This affects the Date and the Time format, specially within formulas.
|
| Also it seems that the locale setting on Cell Format only works if the
| locale is NOT the default.
| i.e. A file with the default in UK Eng. and a cell date in Italian and
| another in UK Eng, will have the cell in Italian on a Dutch computer but
the
| UK one will be turned into Dutch.
|
| Besides, this setting does not work within a cell.
| i.e. the formula TEXT(E12,"*yymmdd")&"-Blabla" will look like
050216-Blabla
| on a UK Eng, but will look yy0216-Blabla on a Dutch or Italian computer
|
| I appreciate any help. This is a problem posted yesterda



  #4   Report Post  
Dave Peterson
 
Posts: n/a
Default

For me (USA settings), Jim's code put:

y
m
d

In A1:A3

Then Jim's formula:
=TEXT(F2,REPT(A2,2)&"."&REPT(A3,2)&"."&REPT(A1,4))
uses those codes to build the text string

So Rept(A2,2) will look like: mm
Rept(A3,2) will look like: dd
Rept(A1,4) will look like: yyyy

or if I substituted (manually), I'd get:
=TEXT(F2,"mm.dd.yyyy")

=======
So you could make that macro run each time you open the workbook--just name it
auto_open().

If you put those strings on a separate worksheet (hidden?????), you can use them
in your formula:

=TEXT(F2,REPT(Sheet2!A2,2)&"."&REPT(Sheet2!A3,2)&" ."&REPT(Sheet2!A1,4))

(I used Sheet2 as my hidden worksheet.)

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Short course:

Open your workbook.
Hit alt-f11 to get to the VBE (where macros/UDF's live)
hit ctrl-R to view the project explorer
Find your workbook.
should look like: VBAProject (yourfilename.xls)

right click on the project name
Insert, then Module
You should see the code window pop up on the right hand side

Paste the code in there.

Make sure you have a worksheet named Sheet2. Then close (and save) that
workbook and reopen it.

Now try the variation of Jim's worksheet formula as a test.



n.almeida wrote:

Hi Jim
Thanks for your answer.
Unfortunately I am not familiar with macros. I would appreciate if you could
direct me a bit on this.
However, from your answer I think you misunderstood (or I misunderstood your
reply): I do not want to have the the format of the region of the user, quite
the opposite I want to override them in order to have the same format
independently of the region odf the user.

"Jim Rech" wrote:

You should avoid like the plague any functions that use region-specific
strings like TEXT. Otherwise you'll have to find a way of determining
dynamically the format codes you need in the region of the user.

One way is with a macro. Just as an example, this macro returns the three
date codes of the current region:

Sub ListDateCode()
Range("A1").Value = Application.International(xlYearCode)
Range("A2").Value = Application.International(xlMonthCode)
Range("A3").Value = Application.International(xlDayCode)
End Sub

Then you could refer to these results like this:
=TEXT(F2,REPT(A2,2)&"."&REPT(A3,2)&"."&REPT(A1,4))

--
Jim Rech
Excel MVP
"n.almeida" wrote in message
...
|I appreciate any help. This is a problem I posted yesterday probably
without
| being very clear.
|
| How can I override the Windows Regional settings so that my Excel File
looks
| the same in a computer in Italy and in the Netherlands without forcing the
| user to change the Locale Regional settings?
| This affects the Date and the Time format, specially within formulas.
|
| Also it seems that the locale setting on Cell Format only works if the
| locale is NOT the default.
| i.e. A file with the default in UK Eng. and a cell date in Italian and
| another in UK Eng, will have the cell in Italian on a Dutch computer but
the
| UK one will be turned into Dutch.
|
| Besides, this setting does not work within a cell.
| i.e. the formula TEXT(E12,"*yymmdd")&"-Blabla" will look like
050216-Blabla
| on a UK Eng, but will look yy0216-Blabla on a Dutch or Italian computer
|
| I appreciate any help. This is a problem posted yesterda




--

Dave Peterson
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
override language settings on date n.almeida Excel Discussion (Misc queries) 0 February 15th 05 02:45 PM
How do I override fixed decimal place settings in EXcel 2003? jroyv Excel Worksheet Functions 2 February 11th 05 06:07 PM
Preserve Excel page settings ADC Excel Discussion (Misc queries) 5 February 5th 05 08:24 PM
decimal point override does not work Sam Brauen Excel Discussion (Misc queries) 0 January 6th 05 05:29 PM
Autocomplete works with my home computer but not the office computer Andy Excel Discussion (Misc queries) 4 December 11th 04 07:21 PM


All times are GMT +1. The time now is 09:44 PM.

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

About Us

"It's about Microsoft Excel"