While.... Wend problem

Hi, in the attachment, I have a Macro Button called "Test" which populates amongst others in Column AI a field called "Date of Break". For some reason, the rows highlighted in the attachment have populated American-style dates, instead of European. Can anyone tell me why?
DummyRec2.xlsm
JustincutAsked:
Who is Participating?
 
MacroShadowConnect With a Mentor Commented:
What???
0
 
MacroShadowConnect With a Mentor Commented:
Try setting the format of the cells using
Cells(x, x).NumberFormat = "dd/mm/yyyy"
0
 
Ken ButtersCommented:
Do you need to change your locale settings?

go to control panel... select Region and Language Options...

there under the formats tab, you should be able to select the local you want... and then modify specific formats if they are not what you expect....

So for example you may want to select

English (United Kingdom)  rather than English (United States).

After that, you can still choose various formats as defaults for your date settings.
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
JustincutAuthor Commented:
I do not understand as only 6 rows in 300 rows shows the Date in American Format.Please look at the attachment to tell me why its only a minority of Cells.
0
 
MacroShadowCommented:
My guess would be that the other ones were entered as text and those were entered as dates, hence they are influenced by the locale settings.
0
 
Ken ButtersCommented:
Is it possible that the workbook was created on a different machine with locale settings set to UK.... and then when you ran the macro... it used your locale settings of United States?
0
 
JustincutAuthor Commented:
I've requested that this question be closed as follows:

Accepted answer: 0 points for Justincut's comment #a39840498

for the following reason:

Excelent
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.