excel date formatting


Posted by Basil Thomas on July 23, 2001 1:47 PM

how do you format a cell to a particular date format
using VBA code?



Posted by Alex on July 24, 2001 4:09 AM

Basil,

Try something like...

Sub dateformatting()
' Select the range you need to format
Range("A1").Select
' Format it however you need to, e.g.
Selection.NumberFormat = "mm/dd/yy"
End Sub

Alex