Results 1 to 7 of 7

VBA -- Compare two dates and map "Yes" or " No" -- Getting Syntax Error at FormulaR1C1

Threaded View

  1. #1
    Forum Contributor
    Join Date
    06-05-2013
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2016
    Posts
    110

    VBA -- Compare two dates and map "Yes" or " No" -- Getting Syntax Error at FormulaR1C1

    Dear all,

    I'm trying to compare two dates from two different column values. If they are same, I need to map as "Yes" and otherwise "No".

    I've written a Formula and getting an error at the following line in my code:

    ActiveCell.FormulaR1C1 = "=IF(RC[" & M_SD_Col - M_NS_Col & "]" & "=" & "RC[" & M_TD_Col - M_NS_Col & "]" & ",'Yes',No')"
    Goal is to calculate the same using formula.

    Ex:

    A B C
    Emp No Start Date Term Date No Show?
    1 3/6/2017 3/6/2017
    2 11/28/2016

    In the end, value under "No Show?" column should be:

    =IF(A2=B2),"Yes","No"

    PFA for the sheet with error at the code mentioned above.

    Request your help in fixing this line of code

    Thanks,
    Vinod Krishna
    Attached Files Attached Files
    Last edited by Vinod Krishna.C; 05-21-2018 at 12:25 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 5
    Last Post: 02-05-2019, 12:03 AM
  2. [SOLVED] Column X-Ref list - Sheet1 Col A "pages", Col B:FL "Req" to Sheet2 ColA "req", ColB "page"
    By excel-card-pulled in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 04-07-2017, 09:30 AM
  3. Replies: 35
    Last Post: 01-13-2016, 02:16 AM
  4. IF Statement to compare two dates and insert "Yes" or "No" in a third cell
    By tbrookes3 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-03-2015, 11:44 PM
  5. = EMBED("Forms.ComboBox.1","") error "Reference not valid."
    By CatharinaCatharina in forum Excel General
    Replies: 2
    Last Post: 12-11-2014, 09:58 AM
  6. Replies: 4
    Last Post: 11-17-2013, 12:05 PM
  7. [SOLVED] How to Count number of "Error" and "OK" after the word "Instrument" found in table row
    By eltonlaw in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-17-2012, 06:26 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