View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default changing date format by macro in excel2000

Hi Rozent,

Try:
'=============
Sub ATest()
Dim rng As Range
Dim rCell As Range
Dim WB As Workbook
Dim SH As Worksheet

Set WB = ActiveWorkbook '<<======= CHANGE

For Each SH In WB.Worksheets
Set rng = SH.UsedRange
For Each rCell In rng.Cells
If rCell.NumberFormat Like "*/*/yyyy" Then
rCell.NumberFormat = "dd/mm/yy"
End If
Next rCell
Next SH

End Sub
'<<=============


---
Regards,
Norman



"?????" wrote in message
...
i want to build a macro to change the format of the current workbook
from dd/mm/yyyy to dd/mm/yy
in excel2000
win XP

thank you
rozent