+ 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
    55

    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
    East Sussex, UK
    MS-Off Ver
    2016 primarily
    Posts
    7,306

    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

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

    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)

Similar Threads

  1. [SOLVED] Help with "Compile Error: Expected: Expression"
    By Dan Imal in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-19-2018, 12:45 PM
  2. [SOLVED] Shell Function "Compile Error: Expected procedure, not variable"
    By s0713190@gmail.com in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 08-09-2014, 01:20 PM
  3. [SOLVED] Compile Error - "Expected array "- when declaring a string variable??
    By wazimu13 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-09-2013, 03:20 PM
  4. Why is this code gives "Compile error Expected: list seperator or)"
    By arungene in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-30-2012, 10:08 AM
  5. [SOLVED] Problem with "Compile error: Expected Fuction or variable"
    By perducci in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-21-2012, 11:59 AM
  6. GoTo compile error: "Expected: line number or label"
    By elfsprin in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-29-2011, 09:21 PM
  7. Mac issue (please help) "Compile error: Expected Function or variable"
    By m1notaur in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-22-2011, 06:00 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