+ Reply to Thread
Results 1 to 5 of 5

Syntax Error 1004

Hybrid View

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

    Re: Syntax Error 1004

    Hi Kaper,

    Thanks for your response. I tried your formula and it doesn't return anything.

    I have attached a dummy workbook.

    Sheet 1 has your formula applied in column D.
    Sheet 2 has your formula with ; & , swapped.
    Sheet 3 has my formula.
    Sheet 4 I recorded a macro with my formula and I get a message to debug then the syntax error.

    Here is the VBA script - It highlights from ActiveCell to the end of the formula in yellow.

    Sub Macro1()
    '
    ' Macro1 Macro
    '
    
    '
        Range("D2").Select
        ActiveCell.FormulaR1C1 = _
            "=IF(ISNUMBER(SEARCH(""coles"",RC[2])),""Groceries"",IF(ISNUMBER(SEARCH(""woolworths"",RC[2])),""Groceries"",IF(ISNUMBER(SEARCH(""pharmacy"",RC[2])),""Pharmacy"",IF(ISNUMBER(SEARCH(""bupa"",RC[2])),""Health Insurance"",IF(ISNUMBER(SEARCH(""tcs"",RC[2])),""Hair"",IF(ISNUMBER(SEARCH(""medical"",RC[2])),""Medical"",IF(ISNUMBER(SEARCH(""interest"",RC[2])),""Interest"",IF" & _
            "R(SEARCH(""xero"",RC[2])),""Accounting"",IF(ISNUMBER(SEARCH(""top up"",RC[2])),""CC Exp"",IF(ISNUMBER(SEARCH(""thomas"",RC[2])),""Income"",IF(ISNUMBER(SEARCH(""telstra"",RC[2])),""Phone"",IF(ISNUMBER(SEARCH(""ep loan"",RC[2])),""EP Exp"",IF(ISNUMBER(SEARCH(""Tville loan"",RC[2])),""Tville Exp"",IF(ISNUMBER(SEARCH(""ergon"",RC[2])),""Power"",IF(ISNUMBER(SEARCH(""unit" & _
            "[2])),""Tville Inc"",IF(ISNUMBER(SEARCH(""car"",RC[2])),""Car Exp"",IF(ISNUMBER(SEARCH(""townsville city"",RC[2])),""Tville Exp"",IF(ISNUMBER(SEARCH(""LSC"",RC[2])),""EP Exp"",""""))))))))))))))))))"
        Range("D2").Select
        Selection.AutoFill Destination:=Range("D2:D20"), Type:=xlFillDefault
        Range("D2:D20").Select
        Range("F2").Select
    End Sub
    I am interested if you can replicate my issue.

    Cheers
    T
    Attached Files Attached Files
    Last edited by Tip1985; 06-24-2015 at 05:39 PM. Reason: To Add code tags

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