View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
keepITcool keepITcool is offline
external usenet poster
 
Posts: 2,253
Default Why does this formatting macro not work?


1. One thing you know for certain :
the "\" forces the next character to be interpreted as a literal string,
thus avoiding any "intelligence" behind the code Excel uses to
interpret/translate user input.

try your code WITH the backslash and you'll get consistent behaviour.
note D1 will give you standard (user-locale) date.

Sub t()
[a1].NumberFormat = "m\/d\/yy"
[b1].NumberFormat = "m\/d"
[c1].NumberFormat = "d\/yy"
[a1:d1] = #3/5/2003#
End Sub



keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"Paul B" wrote:

keepITcool , if I put it like this it works
,Columns("A:A").NumberFormat = "m\/d\/yy" , but I can't understand why
this works Columns("A:A").NumberFormat = "m/d" but this does not
Columns("A:A").NumberFormat = "m/d/yy"? Thanks