+ Reply to Thread
Results 1 to 3 of 3

Using evaluate and not using evaluate changes date format?

  1. #1
    Registered User
    Join Date
    06-06-2014
    Location
    Hong Kong
    MS-Off Ver
    2010
    Posts
    91

    Using evaluate and not using evaluate changes date format?

    Hi there,

    Have a question on evaluate in a formula.

    If I don't use evaluate and have
    Please Login or Register  to view this content.
    within my formula (of a much bigger formula) using the British date format of D/M/Y it works fine (The date I am comparing to is of course in the British format).
    iniMonth and iniYear being custom fields that the user will enter in the excel sheet to check date ranges.

    however if the formula is encapsulated in an evaluate function the value it returns is different as it then takes day and month as month and day thus the 1 is the month and iniMonth is used for the day (I assume it's switching to US date format).

    This makes no sense to me.

    Does anyone know what's going on and is there a simple way to permanently set date format within the formula?

    It can't be set in excel itself as it needs to be portable and other people who use it might use different date formats.

    Thanks.

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Using evaluate and not using evaluate changes date format?

    Dates are always US format in vba, so better like
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    06-06-2014
    Location
    Hong Kong
    MS-Off Ver
    2010
    Posts
    91

    Re: Using evaluate and not using evaluate changes date format?

    Ah I see, I guess the non-evaluate method just pastes the formula into excel which is using the british format but when using the evaluate and calculating within vba it auto converts to US.
    Thanks better understood.

+ 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. Replies: 3
    Last Post: 06-07-2020, 01:49 PM
  2. Conditional Formatting Formula to evaluate date Range
    By scsuflyboy in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-19-2018, 05:04 PM
  3. [SOLVED] Evaluate textbox and display in Format
    By subbby in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 05-07-2016, 07:20 PM
  4. [SOLVED] How to use an IF statement to evaluate two different cells with a number and a date
    By scsuflyboy in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 12-10-2012, 11:11 PM
  5. [SOLVED] MACRO - IF Statement to evaluate if Date falls BETWEEN to Dates - Please help.
    By tdguy09 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-05-2012, 07:17 PM
  6. Vba: Using Evaluate Sumproduct / Countifs combination for Date
    By vidyuthrajesh in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-29-2012, 07:44 PM
  7. VBA: using Evaluate with sumproduct function ( Date Comparison not working)
    By vidyuthrajesh in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-22-2012, 05:36 AM

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