+ Reply to Thread
Results 1 to 7 of 7

Keep original date format after execution

  1. #1
    Registered User
    Join Date
    10-22-2018
    Location
    Turkey
    MS-Off Ver
    Office2010
    Posts
    84

    Question Keep original date format after execution

    Hi,
    My codes are below and seem working well except for a small problem after execution. The dates formats are being converted to “dd.mm.yyyy” even though I add a piece of code to retrieve the previous date format of “dd.mm.yy”.
    My question is how to keep the original date format of “dd.mm.yy” after execution. Thanks in advance for your prompts.

    Please Login or Register  to view this content.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,440

    Re: Keep original date format after execution

    Get rid of the Format in each case.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    10-22-2018
    Location
    Turkey
    MS-Off Ver
    Office2010
    Posts
    84

    Question Re: Keep original date format after execution

    Dear TMS,
    I am not sure whether I understood right but add this code
    Please Login or Register  to view this content.
    after "DateAdd" lines but did not help. My code is converting the dates to next year only without touching days & months. Unfortunately the vba is also changing my original date format from "dd.mm.yy" to "dd.mm.yyyy" but need to keep it same as "dd.mm.yy". You can see my sample file in attachment. Thanks
    Attached Files Attached Files

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,440

    Re: Keep original date format after execution

    No. VBA Format is like the Excel Text function ... so you get text out of it. After that, it doesn't matter what format you clear or apply, it won't make any difference. So lose the Format.

    Please Login or Register  to view this content.
    needs to become
    Please Login or Register  to view this content.

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,440

    Re: Keep original date format after execution

    This
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    10-22-2018
    Location
    Turkey
    MS-Off Ver
    Office2010
    Posts
    84

    Re: Keep original date format after execution

    That's what I need. Thank you very much indeed

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,440

    Re: Keep original date format after execution

    You're welcome. Thanks for the rep.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Format painting formula to adjacent cell, and want the result to be in the original format
    By SF1eagles in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-03-2014, 10:49 AM
  2. Why is my cell format changing after code execution?
    By kmakjop in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-08-2012, 01:44 PM
  3. [SOLVED] Date Time of Last Execution
    By JB2010 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-22-2006, 10:35 AM
  4. Date controlled function execution
    By Bob Phillips in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-06-2005, 07:05 AM
  5. [SOLVED] Date controlled function execution
    By Bob Phillips in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-06-2005, 04:05 AM
  6. [SOLVED] Date controlled function execution
    By Greg Snidow in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM
  7. Date controlled function execution
    By Greg Snidow in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM
  8. [SOLVED] Date controlled function execution
    By Greg Snidow in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM

Tags for this Thread

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