+ Reply to Thread
Results 1 to 4 of 4

Compile error: Expected error: End of statement

  1. #1
    Registered User
    Join Date
    07-06-2016
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    19

    Wink Compile error: Expected error: End of statement

    Range("B1").Formula = "=(""TPR""&" "&TEXT(profitloss!B3,"mmmm")&" "&YEAR(profitloss!B3))"

    This is the code I am trying to run. I know i have to use double apostrophes in places but I am unsure where and I can't seem to get it to work.

    Thanks

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,923

    Re: Compile error: Expected error: End of statement

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


    BSB

  3. #3
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Compile error: Expected error: End of statement

    Hi,

    Any quotation marks within the formula string must be doubled. The formula can also be simplified as you are formatting a date. Therefore the code could become

    Please Login or Register  to view this content.
    Last edited by xlnitwit; 07-14-2016 at 08:01 AM.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  4. #4
    Registered User
    Join Date
    07-06-2016
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    19

    Re: Compile error: Expected error: End of statement

    thanks you both

+ 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] Compile error: Expected end of statement
    By RoOmIE in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-08-2013, 10:04 AM
  2. [SOLVED] Compile Error: Expected: End of Statement
    By eemiller1997 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-14-2012, 09:37 AM
  3. [SOLVED] Compile error: Expected end of statement
    By nenadmail in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-29-2012, 07:12 PM
  4. Replies: 4
    Last Post: 05-16-2012, 05:33 PM
  5. compile error, Expected: end of statement
    By Gti182 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-17-2010, 08:30 AM
  6. Compile Error Expected: End of statement
    By AKarmyguy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-03-2010, 02:20 AM
  7. How to fix a Compile Error Expected: End of statement.
    By AKarmyguy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-03-2010, 02:19 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