Results 1 to 5 of 5

Thread: [RESOLVED] find the error in the formula

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2006
    Location
    Montreal, Canada
    Posts
    152

    Resolved [RESOLVED] find the error in the formula

    Hi guys,
    I'm getting a Run Time Error 1004, Application-defined or object-defined Error in the formula below.

    I've tried almost everything except the right thing, can you find it???

    VB Code:
    1. ActiveCell.Offset(0, 4).Formula = "=IF((" & ActiveCell.Offset(0, 2).Address & "<" & ActiveCell.Offset(0, 3).Address & "),"",(" & ActiveCell.Offset(0, 2).Address & "  / (" & ActiveCell.Offset(0, 2).Address & "-" & ActiveCell.Offset(0, 3).Address & "))-1)"

    thanks

  2. #2
    Frenzied Member DKenny's Avatar
    Join Date
    Sep 2005
    Location
    on the good ship oblivion..
    Posts
    1,171

    Re: find the error in the formula

    Bill
    Are you sure you should be using the Address property of the cells and not the Value property?

    What exactly are you trying to achieve?
    Declan

    Don't forget to mark your Thread as resolved.
    Take a moment to rate posts that you think are helpful

  3. #3
    Frenzied Member DKenny's Avatar
    Join Date
    Sep 2005
    Location
    on the good ship oblivion..
    Posts
    1,171

    Re: find the error in the formula

    Ignore previous posts.

    Try this
    "=IF((" & ActiveCell.Offset(0, 2).Address & "<" & ActiveCell.Offset(0, 3).Address & "), 0,(" & ActiveCell.Offset(0, 2).Address & " / (" & ActiveCell.Offset(0, 2).Address & "-" & ActiveCell.Offset(0, 3).Address & "))-1)"

    I change the TRUE result to a Zero, rather than a "" and it now works.
    Declan

    Don't forget to mark your Thread as resolved.
    Take a moment to rate posts that you think are helpful

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Jan 2006
    Location
    Montreal, Canada
    Posts
    152

    Re: find the error in the formula

    I'm building a template sheet.
    Like
    ITEM Name Sales TY Sales LY % DIFF
    A
    B
    C
    TOTAL

    D
    E
    F
    TOTAL

    G
    H
    I
    TOTAL


    I need the formula to be paste a each TOTAL line
    Even by using Value proterty, I'm getting the same error

    Thanks

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Jan 2006
    Location
    Montreal, Canada
    Posts
    152

    Re: find the error in the formula

    damn Right

    Thanks Declan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width