LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Texttocolumns and Date Format using Macro - UK International setti

Would appreciate any help on this one. Using Excel 2003 / Windows XP SP2.

I import information from a database - this includes dates that are in
MM/DD/YYYY format. As I am in the UK, Excel's auto-features convert some of
the dates correctly, others incorrectly. I therefore use the
data/texttocolumns function to give correct dates - have done this many times.

I have just tried to record a macro using these steps (remembering to select
the MDY option for the date format). The result was perfect when recording.
However, when running the macro on fresh data, it failed - an example is a
data that when imported was
5/1/2007 (1 May 2007, US format)

and when manually changed using text to columns shows as
1/5/2007 (1 May 2007, UK format).

converting using the recorded macro gives the result
5/1/2007 (5 Jan 2007, UK format)

I suspect this may be caused in some way by the International Date settings
being ignored by the macro, but used in manual activity. However I have no
idea how to change the behaviour within a macro.

I could re-write the whole macro so that I parse each cell and assign the
values to the correct date component, but that would be much of a
sledge-hammer to crack a nut.

Thanks for reading this - hope you can help me.

--
KenY
 
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
how format date with TEXT() function for international usage? AlexBY Excel Worksheet Functions 3 May 8th 09 06:38 PM
Working with times in military/international format. MidWest Yankee Excel Discussion (Misc queries) 2 April 8th 08 03:29 PM
Macro Problem TextToColumns WAMTC Excel Programming 6 August 8th 07 05:44 PM
Format function with international numbers Alex St-Pierre Excel Programming 2 March 17th 07 10:52 PM
date format in excel not in line with control panel regional setti GrahamR Excel Discussion (Misc queries) 3 August 2nd 05 06:48 PM


All times are GMT +1. The time now is 07:23 PM.

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"