Results 1 to 5 of 5

Syntax Error 1004

Threaded View

  1. #1
    Registered User
    Join Date
    06-24-2015
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    8

    Syntax Error 1004

    Hi,

    I am trying to create a macro with VBA using the following formula:

    =IF(ISNUMBER(SEARCH("coles",F2)),"Groceries",IF(ISNUMBER(SEARCH("woolworths",F2)),"Groceries",IF(ISNUMBER(SEARCH("pharmacy",F2)),"Pharmacy",IF(ISNUMBER(SEARCH("bupa",F2)),"Health Insurance",IF(ISNUMBER(SEARCH("tcs",F2)),"Hair",IF(ISNUMBER(SEARCH("medical",F2)),"Medical",IF(ISNUMBER(SEARCH("interest",F2)),"Interest",IF(ISNUMBER(SEARCH("xero",F2)),"Accounting",IF(ISNUMBER(SEARCH("top up",F2)),"CC Exp",IF(ISNUMBER(SEARCH("thomas",F2)),"Income",IF(ISNUMBER(SEARCH("telstra",F2)),"Phone",IF(ISNUMBER(SEARCH("ep loan",F2)),"EP Exp",IF(ISNUMBER(SEARCH("Tville loan",F2)),"Tville Exp",IF(ISNUMBER(SEARCH("ergon",F2)),"Power",IF(ISNUMBER(SEARCH("unit  51",F2)),"Tville Inc",IF(ISNUMBER(SEARCH("car",F2)),"Car Exp",IF(ISNUMBER(SEARCH("townsville city",F2)),"Tville Exp",IF(ISNUMBER(SEARCH("LSC",F2)),"EP Exp",""))))))))))))))))))
    When I try to run the macro it comes up with a syntax error 1004.

    If I reduce the formula to

    =IF(ISNUMBER(SEARCH("coles",F2)),"Groceries",IF(ISNUMBER(SEARCH("woolworths",F2)),"Groceries",IF(ISNUMBER(SEARCH("pharmacy",F2)),"Pharmacy",IF(ISNUMBER(SEARCH("bupa",F2)),"Health Insurance",IF(ISNUMBER(SEARCH("tcs",F2)),"Hair",IF(ISNUMBER(SEARCH("medical",F2)),"Medical",""))))))
    it works fine.

    It is as though VBA can only handle up to a certain formula length.

    Could anyone help?

    Cheers
    T
    Last edited by Tip1985; 06-25-2015 at 01:11 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Excel macro (compile error. syntax error.) error
    By salar_younis in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-06-2014, 06:11 AM
  2. [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
  3. Error "run-time Error '1004': General Odbc Error
    By D4WNO77 in forum Access Tables & Databases
    Replies: 2
    Last Post: 07-16-2012, 09:55 AM
  4. Run time error 1004 syntax problem
    By 1eyedjack in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-22-2010, 04:51 AM
  5. Syntax error 1004 at ".Refresh BackgroundQuery:=False"
    By roth_georg in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-30-2008, 07:58 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