Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default Fixing the date format in a macro or VBA

I have created a macro of which part is to convert an incorrect date format,
dots instead of dashes, that works fine on my PC. (using Ctrl H to find and
replace . with / in the column)
Unfortunately when the macro is run on other machines the date format
becomes Americanised. And as such something like 08/05/09 becomes 05/08/09
which messes up other calculations done within the macro. The other machines
are set up as Australian so I am assuming the macro somehow loses its local
setting control when not being run on the authors machine.
Is there some way that I can lock the date format as Australian or as
dd/mm/yyyy within the macro?
--

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 523
Default Fixing the date format in a macro or VBA

Hi,

If you had your dates in column A then include this line after your macro
has done find/replace:

columns("A:A").numberformat = "dd/mm/yyyy"


"Geoff B" wrote:

I have created a macro of which part is to convert an incorrect date format,
dots instead of dashes, that works fine on my PC. (using Ctrl H to find and
replace . with / in the column)
Unfortunately when the macro is run on other machines the date format
becomes Americanised. And as such something like 08/05/09 becomes 05/08/09
which messes up other calculations done within the macro. The other machines
are set up as Australian so I am assuming the macro somehow loses its local
setting control when not being run on the authors machine.
Is there some way that I can lock the date format as Australian or as
dd/mm/yyyy within the macro?
--

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Message box date format macro help Aaron Excel Worksheet Functions 2 June 16th 09 08:16 AM
Message box date format macro help Aaron Excel Worksheet Functions 2 June 16th 09 07:17 AM
date format problem using Macro mohavv Excel Discussion (Misc queries) 1 October 15th 08 01:09 AM
Fixing a vlookup macro that returns #N/A error Grosvenor Excel Discussion (Misc queries) 1 February 8th 06 12:23 PM
Fixing the date. cs2883 New Users to Excel 7 October 7th 05 07:40 PM


All times are GMT +1. The time now is 07:04 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"