PDA

View Full Version : Solved: Change Date Format VBA



BENSON
11-21-2007, 11:48 PM
The following code paste,s the current date into a cell:


Set WsTgt = Workbooks("Gardens History.xls").Sheets(1)
With WsTgt.Range("A" & NextEmptyRow(WsTgt))
.Value = Date


The pasted cell shows to day for instance as being (quite correctly ) 2007/11/22

Is it possible to change the code so the pasted cell shows

THURS 22 NOV 07

THANKS FOR ANY HELP

JimmyTheHand
11-22-2007, 12:10 AM
Try both numberformat options, maybe one of them will be OK.

Set WsTgt = Workbooks("Gardens History.xls").Sheets(1)
With WsTgt.Range("A" & NextEmptyRow(WsTgt))
.Value = Date
.NumberFormat = "dddd dd mmm yy"
.NumberFormat = "ddd dd mmm yy"

Jimmy

BENSON
11-22-2007, 10:00 PM
BOTH WORKED THANK YOU