View Single Post
  #3   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?

Tested on xlXP (english) and xl97 (Dutch)

I noted following:
after running your code in Dutch xl97, the cells number format was
"m-d-jj"

so apparently (and not surprisingly) there's some international issue
involved.

to have excel interpret the / as a litteral
precede it with a backslash ..

et voila!


Columns("A:A").NumberFormat = "m\/d\/yy"
For i = 1 To 10
Cells(i, 1) = CLng(Date + i)
Next



keepITcool

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


"Paul B" wrote:

Rocky, the first code I posted was the same as yours, I know it should
work but I tried recording it to make sure it was right, running this
on 2000 at this time