Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Determine Regional Settings Through VBA

Status
Not open for further replies.

ktwclark

Programmer
Jan 30, 2002
54
GB
Hi

I'm looking for an easy way to determine the Regional Settings within Excel. I'm looking to determine the short date format. Any ideas?

Thanks

 
Hi,

You need to check out the International property in the VBA Help.

This is sample code that I use downunder to ensure that the Regional settings are the way I want them:

' Check that the date format is d-m-y - NOT m-d-y (problems!!)
If Application.International(xlMDY) = True Then
Message = "The Windows date format is 'mm-dd-yy' instead of 'dd-mm-yy'. " & (Chr(13)) & _
"Please go to Control Panel and change Regional Settings to " & (Chr(13)) & _
"** English(Australian) ** and then restart Excel."
Title = "Windows Date Format"
MyValue = MsgBox(Message, , Title)
End
End If

I hope this helps.

Regards,

Peter Moran
 
I'm looking to determine the short date format. The code you've supplied determines the country setting.
 
xlDateOrder is the one I'm looking for. Thanks, though, cause you pointed me in the right direction.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top