PDA

View Full Version : [SOLVED] Regional Settings



tactps
01-05-2005, 09:00 PM
I am having a problem with csv files which I am saving via VBA.

The format of my dates in the Excel spreadsheet is dd/mm/yyyy. It appears that when users have their short date in the regional settings set as "dd/mm/yy" this overwrites my macro when the csv is saved.

Is there a way to overwrite the regional settings, or at least examine them in VBA so that I can have the macro stop if these settings are incorrect?

Alternatively, is there a way to force the csv to pick up the correct format?

tactps
01-05-2005, 09:51 PM
I got around the issue by replacing:

activecell.value = Orderdate
with

activecell.value = "'" & Orderdate
to create text instead of a date.

Ken Puls
01-05-2005, 10:00 PM
Hi tactps,

Welcome to VBAX! Sorry someone didn't beat you to your own solution, but thank you for both posting your solution and marking it solved!

Cheers,

Zack Barresse
01-06-2005, 12:31 AM
Tactps! Great to see you post! Sorry I didn't make it in time. :( But glad you got a solution! :D

Hope you had a great new year, give my best to the fam!