+ Reply to Thread
Results 1 to 3 of 3

Excel VBA - Range.FormulaR1C1 "XXXXX" Compile Error: Expected: end of statement

  1. #1
    Registered User
    Join Date
    10-15-2018
    Location
    London, England
    MS-Off Ver
    210
    Posts
    1

    Excel VBA - Range.FormulaR1C1 "XXXXX" Compile Error: Expected: end of statement

    Hi All,

    I am looking to automatically populate a cell with a formula.....

    When trying to use the below I am presented with Compile error: Expected: end of statement, due to the highlighted below........

    With Range("C4")
    .FormulaR1C1 = "=IF('KARDEX DATA'!C2="","0",'KARDEX DATA'!C2)"

  2. #2
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    UK
    MS-Off Ver
    2010 primarily
    Posts
    3,276

    Re: Excel VBA - Range.FormulaR1C1 "XXXXX" Compile Error: Expected: end of statement

    You need to double-up any quotes that are part of the formula

    Please Login or Register  to view this content.
    Rory
    Days when we raged, we flew off the page
    Such damage was done

  3. #3
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    1,252

    Re: Excel VBA - Range.FormulaR1C1 "XXXXX" Compile Error: Expected: end of statement

    Hi

    Try

    Formula: copy to clipboard
    Please Login or Register  to view this content.

    if you want to display 0 (zero as value).

    P.S. @77highland - please use CODE tag to marked any code in post.
    Happy with my answer * Add Reputation.
    If You are happy with solution, please use Thread tools and mark thread as SOLVED.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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