+ Reply to Thread
Page 2 of 2 FirstFirst 1 2
Results 16 to 21 of 21

Date Format Change in other systems and due to that Macro doesn't work properly

  1. #16
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Excel 2016
    Posts
    4,486

    Re: Date Format Change in other systems and due to that Macro doesn't work properly

    @gregM... Exactly! And the op is using tucked away ranges, textboxes, comboboxes... Hard to follow it all and find the best solution. In addition the format function (FMT) he is using formats differently than the cells. Tbh I'm surprised it works even in one regional format
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  2. #17
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2016
    Posts
    4,982

    Re: Date Format Change in other systems and due to that Macro doesn't work properly

    True, and that's why I said that you should always make sure whatever you process make sure you bring it back to the correct numeric (serial) value, requires extra code but that's the only way to get it working.
    A textbox on a userform is okay to show what the user has selected but the calendar should at all time be used to select a date and a date variable to hold the selected date, not just the textbox.
    I'll extract my data form from a file I have and attach it later, explains it better, tells more than all the words
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you ( It doesn't hurt )

  3. #18
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2016
    Posts
    4,982

    Re: Date Format Change in other systems and due to that Macro doesn't work properly

    I didn't find the correct file but I did find my vba module that solves some issues.
    Some reference is in the code as to it's origin but som things were edited by me.
    Place this module in the VBA Project, and then use the following syntax in the vba to format the date (no time just date)

    Please Login or Register  to view this content.
    FormatDate is the string result depending on the system's settings.

    Take a look and see if you can implement it, you can always edit the vba module to include the time part
    Attached Files Attached Files

  4. #19
    Registered User
    Join Date
    09-05-2012
    Location
    Ghaziabad
    MS-Off Ver
    Excel 2003,07,10,13
    Posts
    43

    Re: Date Format Change in other systems and due to that Macro doesn't work properly

    Hello Keebellah,

    Thanks a ton for sharing DateModuleInternational.Zip and the suggestion to use date as serial number not as text in the code, it was really helpful and finally solved the issue with which I was struggling a lot.

    Highly Highly Highly appreciate for your patience with this issue and provide the solution.

    I would like thank Arkadi, Greg M for their valuable inputs as well.

    All in all it has been a great learning for future.

    Best Regards,
    Brajpal Shishodia

  5. #20
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2016
    Posts
    4,982

    Re: Date Format Change in other systems and due to that Macro doesn't work properly

    You're very welcome, that's what we all hope to achieve, pass on ideas we ourselves found and reused or modified.
    Always learning, never too old to learn

  6. #21
    Registered User
    Join Date
    09-05-2012
    Location
    Ghaziabad
    MS-Off Ver
    Excel 2003,07,10,13
    Posts
    43

    Re: Date Format Change in other systems and due to that Macro doesn't work properly

    Yes, can't agree more, therefore, sharing the working template here if anyone need in future to get the solution.

    Many Thanks again.

    Best Regards.
    Attached Files Attached Files

+ Reply to Thread
Page 2 of 2 FirstFirst 1 2

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1