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: 3
Default date formatting in excel VBA

I'm trying to convert a text date - time to internal date format, I can do
this fine by copying the column and past special with add to another column
and pasting back to the first column.
Ive used record macro to create VBA code to do the same, but get american
date format 12/07/05 06:02 becomes 7/12/05 and 13/12/05 06:05 returns null.

The VBA code created by the macro recorder is as follows :-


Sub DateFormatter()
'
' DateFormatter Macro
' Macro recorded 12/7/2005 by Johnsd
'

'
Columns("G:G").Select
Selection.Copy
ActiveWindow.SmallScroll ToRight:=2
Columns("N:N").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlAdd, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
Selection.Cut
ActiveWindow.SmallScroll ToRight:=-7
Columns("G:G").Select

ActiveSheet.Paste
Selection.NumberFormat = "d/m/yyyy h:mm"
End Sub
--
Can anyone help

Thanks in advance

DaveJ
 
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
Formatting date in Excel Bindi721 Setting up and Configuration of Excel 0 January 23rd 10 08:51 AM
Excel date formatting Arron Excel Discussion (Misc queries) 3 February 8th 09 11:30 PM
Date formatting in Excel Ricky4 Excel Discussion (Misc queries) 2 May 8th 08 04:31 PM
date formatting in excel kwood525 Excel Worksheet Functions 5 August 31st 07 07:18 PM
Date formatting in Excel vanness95678 Excel Discussion (Misc queries) 1 January 10th 05 11:24 PM


All times are GMT +1. The time now is 11:12 PM.

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

About Us

"It's about Microsoft Excel"