ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Using VBA to temporarily bypass regional options (https://www.excelbanter.com/excel-programming/355530-using-vba-temporarily-bypass-regional-options.html)

Carim[_3_]

Using VBA to temporarily bypass regional options
 
Hi all,

Is there an elegant way of temporarily asking VBA to stick to its
embedded US core settings, in order to format dates accordingly ...,
and then, once action has been performed, to return to its regional
settings ...

Thanks for all your comments
Cheers
Carim


Bob Phillips[_6_]

Using VBA to temporarily bypass regional options
 
Doesn't it already do that? It is certainly my understanding.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Carim" wrote in message
oups.com...
Hi all,

Is there an elegant way of temporarily asking VBA to stick to its
embedded US core settings, in order to format dates accordingly ...,
and then, once action has been performed, to return to its regional
settings ...

Thanks for all your comments
Cheers
Carim




Carim[_3_]

Using VBA to temporarily bypass regional options
 
Bob,

What I am facing is a French based environment, which needs to trigger
a English report to HQ ...
Format(Date,"mmmm") produces in French mars ...
whereas my objective is to have it show March ...
So far, I have cheated quite inelegantly... ans as wondering if a
couple of instructions could help me temporarily bypass the French
settings ...

Thanks for your comments
Carim


Bob Phillips[_6_]

Using VBA to temporarily bypass regional options
 
Carim,

I see the problem now.

An alternative would be, instead of putting the result in the cell as you
are doing now, put a formula, For instance

Activecell.Formula = "=TEXT(TODAY(),""mmmm"")"

This will have the effect of creating formula that an English version will
interpret as March, and a French version will interpret as Mars.


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Carim" wrote in message
oups.com...
Bob,

What I am facing is a French based environment, which needs to trigger
a English report to HQ ...
Format(Date,"mmmm") produces in French mars ...
whereas my objective is to have it show March ...
So far, I have cheated quite inelegantly... ans as wondering if a
couple of instructions could help me temporarily bypass the French
settings ...

Thanks for your comments
Carim




Carim[_3_]

Using VBA to temporarily bypass regional options
 
Bob,

I already knew this world was unfair ... But now, I am terribly jealous
....

Your suggestion is simply brilliant !!! ... because it is brilliantly
simple ...!!!

Thanks a lot
All the Best

Carim


Bob Phillips[_6_]

Using VBA to temporarily bypass regional options
 
<G Glad we could help.

Bob

"Carim" wrote in message
oups.com...
Bob,

I already knew this world was unfair ... But now, I am terribly jealous
...

Your suggestion is simply brilliant !!! ... because it is brilliantly
simple ...!!!

Thanks a lot
All the Best

Carim





All times are GMT +1. The time now is 09:14 AM.

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