Consulting

Results 1 to 4 of 4

Thread: Regional Settings

  1. #1
    VBAX Regular tactps's Avatar
    Joined
    Jul 2004
    Location
    Melbourne, Australia
    Posts
    10
    Location

    Regional Settings

    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?
    If I offer a penny for your thoughts, will you put your two cents in?

  2. #2
    VBAX Regular tactps's Avatar
    Joined
    Jul 2004
    Location
    Melbourne, Australia
    Posts
    10
    Location

    Thumbs up Solved

    I got around the issue by replacing:
    activecell.value = Orderdate
    with
    activecell.value = "'" & Orderdate
    to create text instead of a date.
    If I offer a penny for your thoughts, will you put your two cents in?

  3. #3
    Moderator VBAX Guru Ken Puls's Avatar
    Joined
    Aug 2004
    Location
    Nanaimo, BC, Canada
    Posts
    4,001
    Location
    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,
    Ken Puls, CMA - Microsoft MVP (Excel)
    I hate it when my computer does what I tell it to, and not what I want it to.

    Learn how to use our KB tags! -||- Ken's Excel Website -||- Ken's Excel Forums -||- My Blog -||- Excel Training Calendar

    This is a shameless plug for my new book "RibbonX - Customizing the Office 2007 Ribbon". Find out more about it here!

    Help keep VBAX clean! Use the 'Thread Tools' menu to mark your own threads solved!





  4. #4
    Site Admin
    Urban Myth
    VBAX Guru
    Joined
    May 2004
    Location
    Oregon, United States
    Posts
    4,940
    Location
    Tactps! Great to see you post! Sorry I didn't make it in time. But glad you got a solution!

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •