Format date

M

MAX

Hello
I'm working on excel 2007 and I have a workbook with 15 sheets. The problem
is that the dates are all in English US and I want them in English UK. What
is the solution to change all the 15 sheets at once?

Thanks in advance.
 
D

David Biddulph

Group the sheets, then format cells.
Then ungroup the sheets to avoid confusion.
 
G

Gary''s Student

The following small macro:

Sub fixum()
Dim sh As Worksheet
Dim r As Range, rng As Range
For Each sh In Sheets
sh.Activate
Set rng = ActiveSheet.UsedRange
For Each r In rng
If r.NumberFormat = "m/d/yyyy" Then
r.NumberFormat = "d/m/yyyy"
End If
Next
Next
End Sub

will loop over all your sheets and change cell formatted like:
12/28/2009
to:
28/12/2009

You will need to modify the code if the original format differs from the
above.

I suggest using a different approach and use something like:
28 December 2009

This is easily understood no matter which side of the Atlantic you are
standing on.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top