Closed Thread
Results 1 to 3 of 3

Run Time Error 1004 - Application-defined or object-defined error

  1. #1
    brent
    Guest

    Run Time Error 1004 - Application-defined or object-defined error

    Can someone tell me why this formula gives me a run time eror?
    Range("E2").Formula = "=IF( AND( NOT(G2),
    NOT(ISBLANK(B2)),NOT(ISBLANK(I2))),TODAY()-I2,"" )"

    or why this also gives the same error?
    Range("E2").Formula = "=IF(G2,I2,"")"


  2. #2
    K Dales
    Guest

    RE: Run Time Error 1004 - Application-defined or object-defined error

    Quotes inside quotes. Try this in the immediate pane:
    ? "=IF(G2,I2,"")"
    you should get
    =IF(G2,I2,")
    which is an invalid formula and therefore the error. Solution is to use ""
    wherever you want ", so """" for "":
    Range("E2").Formula="=IF(G2,I2,"""")"
    and similarly for your other formula
    --
    - K Dales


    "brent" wrote:

    > Can someone tell me why this formula gives me a run time eror?
    > Range("E2").Formula = "=IF( AND( NOT(G2),
    > NOT(ISBLANK(B2)),NOT(ISBLANK(I2))),TODAY()-I2,"" )"
    >
    > or why this also gives the same error?
    > Range("E2").Formula = "=IF(G2,I2,"")"
    >


  3. #3
    Tom Ogilvy
    Guest

    Re: Run Time Error 1004 - Application-defined or object-defined error

    Range("E2").Formula = "=IF(G2,I2,"""")"

    do the same for your other formula.

    double quotes within quotes

    --
    Regards,
    Tom Ogilvy

    "brent" <[email protected]> wrote in message
    news:[email protected]...
    > Can someone tell me why this formula gives me a run time eror?
    > Range("E2").Formula = "=IF( AND( NOT(G2),
    > NOT(ISBLANK(B2)),NOT(ISBLANK(I2))),TODAY()-I2,"" )"
    >
    > or why this also gives the same error?
    > Range("E2").Formula = "=IF(G2,I2,"")"
    >




Closed Thread

Thread Information

Users Browsing this Thread

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

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