+ Reply to Thread
Results 1 to 3 of 3

VBA - putting a formula in cells but its got a syntax error please help!! :-)

  1. #1
    Registered User
    Join Date
    10-17-2013
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    6

    VBA - putting a formula in cells but its got a syntax error please help!! :-)

    Hi

    I have a formula I want to put in a range of cells but it won't let me - what have I done wrong? It says theres an error on the " Total" part? why?


    Range("m2:m" & Cells(Rows.Count, "A").End(xlUp).Row).Formula = "=IF(G6=(G5 & " Total"),IF(K6>$AJ6,"Qualifies","Not Met"),"")"

    Its driving me mad!! please help me

    thanks

    Laura

  2. #2
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: VBA - putting a formula in cells but its got a syntax error please help!! :-)

    You must escape quotation marks in the formula string by doubling them:
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    10-17-2013
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: VBA - putting a formula in cells but its got a syntax error please help!! :-)

    I thought it had something to do with the " but didn't know what to do.

    thank you so much this works great :-) another thing learnt today!

+ 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 1004: Application-defined or object-defined error on Range(Cells(x,y)) syntax
    By winch in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-04-2013, 11:02 AM
  2. activesheet.cells(i, 3).formula SYNTAX ERROR
    By smartphreak in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 03-07-2012, 06:51 AM
  3. Error putting horizontal series of cells into array .....why?
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-23-2011, 10:32 AM
  4. putting formula in cel gives #NAME error
    By Rinze Smit in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-30-2005, 03:05 AM
  5. Error with formula syntax
    By menefist in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-28-2005, 03:42 PM

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