VB help

Posted on 2012-09-09
Last Modified: 2012-09-09
Please can you help with the attached file.

The userform has a calendar object, however the ouput into the textbox (TxtCompletion) is in US format mm/dd/yyyy

Please can you help me change this to UK format dd/mm/yyyy

I did look in properties but was unable to locate, so assume this needs to be done in VB.

Thanks for your help.
Question by:Kiwi-123
    LVL 44

    Accepted Solution

    Just format the calendar control value
    Private Sub Calendar2_Click()
        TxtCompletion.Value = Format(Calendar2.Value, "dd/mm/yyyy")
    End Sub

    Open in new window


    Author Comment

    For some reason when I try that it comes back as an error?

    Could it be because I have another calendar (Calendar1) in another userform.

    Author Comment

    Sorry my mistake, many thanks for your help!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
    Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
    The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
    This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

    759 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

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now