View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Macro to format dates

Sub formatcolumns()
Range("m1,s1").EntireColumn.NumberFormat = "mm/dd/yyyy"

End Sub

--
Don Guillett
SalesAid Software

"Dan R." wrote in message
oups.com...
I'm trying to create a macro that will format some dates on my
spreadsheet...

Column 13 (M) has dates formatted as: Jan 23 2007 12:00AM
- this is always the same length, so Jan 3 would be Jan 3 2007
12:00AM

Column 19 (S) has dates formatted as: 2070109 (which is 1/9/07)

Can someone please help me write a macro to format them as mm/dd/yy,
w/o the time?

I hate to post w/o providing some code but I don't really know where to
start.

Thank You,
Dan