Link to home
Start Free TrialLog in
Avatar of Wilder1626
Wilder1626Flag for Canada

asked on

VBA - Regional setting inside Excel

Hi ,

Would you know a way to force the Regional setting date and time format only inside an excel file?

I have an excel file with date format: mm/dd/yy hh:mm format, but some person from our team have a USA regional setting and they have dd/mm/yyyy hh:mm and this is causing alot of of problem. Due to some applications on their laptop, they cannot change the regional setting.

Would you know if we can form the regional setting only inside this excel file?

Thanks for all your help.

User generated image
ASKER CERTIFIED SOLUTION
Avatar of GrahamSkan
GrahamSkan
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Wilder1626

ASKER

The problem that i have right now is that the excel file file has multiple columns with data time format mm/dd/yy hh:mm. When users put dates in it, everything works fine but if a user open the file when he as the USA regional setting, the date gets wrong. Same thing if he put date and then, we open the file using Canada regional setting.

there is always a problem were it flips the month and day.

User generated image
Number formatting to "Date" will based on the regional settings but if you selected the "Custom" setting, the format of the values should be retained.

can you also upload a sample and we will see if the formatting will be changed or not.

My local machine's date format is : M/d/yyyy
Sure. This is a sample only of the sheet with only A1 with the custom format mm/dd/yy hh:mm .

Please let me know if what format it gives you.

Thanks
mm-dd-yy-hh-mm-sample.xlsx
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi,
I see where the problem is. it is due to bad manipulation of the file.
Thanks for your help. At least I know that the regional setting cannot be by pass in excel, but the custom format is a good option.
Thanks