+ Reply to Thread
Results 1 to 6 of 6

Getting error 2042 while using match function on dates

  1. #1
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    Getting error 2042 while using match function on dates

    Hi Guys,

    i am using match as formula and works like a charm:

    Screenshot_70.png

    but when i am doing the same in code i am getting error 2042:

    Please Login or Register  to view this content.
    why?

    Jacek
    Attached Files Attached Files

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,176

    Re: Getting error 2042 while using match function on dates

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Last edited by sintek; 08-02-2020 at 05:08 AM.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  3. #3
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    Re: Getting error 2042 while using match function on dates

    thank you sintek,

    why this is working?

    Jacek

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,176

    Re: Getting error 2042 while using match function on dates

    Dates are tricky...Best to convert to long or double when doing a search....
    This also works...
    Please Login or Register  to view this content.
    Last edited by sintek; 08-02-2020 at 05:29 AM.

  5. #5
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    Re: Getting error 2042 while using match function on dates

    thank you!

    Jacek

  6. #6
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,176

    Re: Getting error 2042 while using match function on dates

    Glad I could assist...tx for 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] Error 2042 while comparing dates
    By Roshan.Shakya in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-09-2019, 03:13 PM
  2. Setting variable equal to match result- error 2042
    By Feethurt in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-10-2019, 03:21 PM
  3. Modify DateTime for Application.Match - error 2042
    By domgilberto in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-21-2016, 09:02 AM
  4. [SOLVED] Error 2042 for application.match
    By a.hudrea in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-04-2016, 03:41 AM
  5. Error 2042 on Application.Match formula
    By krazyhype19 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-05-2015, 03:25 AM
  6. [SOLVED] Error 2042 using Application.Match to add item and update combobox list
    By newbi004 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-14-2013, 07:55 AM
  7. Error 2042 with Application.Match
    By mgurren in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-08-2013, 02:15 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