Consulting

Results 1 to 5 of 5

Thread: Solved: Iserror in VBA setup

  1. #1
    VBAX Contributor
    Joined
    Jun 2009
    Posts
    110
    Location

    Solved: Iserror in VBA setup

    Hello,

    How can i set this formula in VBA with the "iserror"?

    [VBA].Offset(3, -2).FormulaR1C1 = "=LOOKUP(2,1/((R27C7:R" & lngLastRow & "C7=R[-2]C[2])*(R27C28:R" & _
    lngLastRow & "C28=R[1]C)),R27C11:R" & lngLastRow & "C11)"[/VBA]

    Thanks...

  2. #2
    Site Admin
    Urban Myth
    VBAX Guru
    Joined
    May 2004
    Location
    Oregon, United States
    Posts
    4,940
    Location
    Use the Evaluate() method to get the formulas return. You can then check the returned result.

    HTH

  3. #3
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    ActiveCell.Offset(3, -2).FormulaR1C1 = _
    "=IF(ISERROR(LOOKUP(2,1/((R27C7:R" & lngLastRow & "C7=R[-2]C[2])*(R27C28:R" & _
    lngLastRow & "C28=R[1]C)),R27C11:R" & lngLastRow & "C11)),""""," & _
    "LOOKUP(2,1/((R27C7:R" & lngLastRow & "C7=R[-2]C[2])*(R27C28:R" & _
    lngLastRow & "C28=R[1]C)),R27C11:R" & lngLastRow & "C11))"
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  4. #4
    VBAX Contributor
    Joined
    Jun 2009
    Posts
    110
    Location
    Not even sure how to set it up using your suggestion Zack. :-(. Aint't that keen yet using VBA....


    Thankx XLD...i almost had it, something like yours except for some quotation missing...

    Gracias...

  5. #5
    Site Admin
    Urban Myth
    VBAX Guru
    Joined
    May 2004
    Location
    Oregon, United States
    Posts
    4,940
    Location
    Ah, I thought you meant you wanted to check if it was an error in VBA. Glad you have it working though.

Posting Permissions

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