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: 2,069
Default Macro + Dates formatting issue

Hi All,

Formatting issue with a macro.

Report with dates formatted as dd.mm.yyyy is changed by

Columns("G:G").Select
Selection.Replace What:=".", Replacement:="/", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.NumberFormat = "dd/mm/yyyy;@"
Columns("A:N").Select
Selection.Sort Key1:=Range("G2"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("B1").Select

BUT, on some cells, the format of the date = mm/dd/yyyy.

Subsequently my sort is incorrect. Seriously going bald over this one.

Any help much appreciated.

Cheers

John
 
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
Issue with dates being pasted correctly jwearne Excel Discussion (Misc queries) 3 April 1st 09 07:28 PM
When subtracting dates issue Adnan Excel Discussion (Misc queries) 11 March 8th 08 11:01 AM
subtracting two dates issue Outbacker Excel Discussion (Misc queries) 2 August 29th 06 05:46 PM
Issue with copy/paste dates from filtered data deacs Excel Discussion (Misc queries) 3 January 5th 06 03:09 PM
Macro for formatting columns with dates, weekdays, and widths? [email protected] Excel Programming 0 January 27th 05 07:19 PM


All times are GMT +1. The time now is 05:49 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"