Solved

While.... Wend problem

Posted on 2014-02-06
7
99 Views
Last Modified: 2014-02-13
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
0
Comment
Question by:Justincut
  • 3
  • 2
  • 2
7 Comments
 
LVL 27

Assisted Solution

by:MacroShadow
MacroShadow earned 500 total points
ID: 39840143
Try setting the format of the cells using
Cells(x, x).NumberFormat = "dd/mm/yyyy"
0
 
LVL 19

Expert Comment

by:Ken Butters
ID: 39840459
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
 

Author Comment

by:Justincut
ID: 39840498
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
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
LVL 27

Expert Comment

by:MacroShadow
ID: 39840516
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
 
LVL 19

Expert Comment

by:Ken Butters
ID: 39840536
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
 

Author Comment

by:Justincut
ID: 39854789
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
 
LVL 27

Accepted Solution

by:
MacroShadow earned 500 total points
ID: 39854790
What???
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

792 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question