[Solved] VBA Code: Debugging a line of code

  • I was wondering if someone could help me with this I don't know whats wrong with it because I don't understand VB. ActiveCell.FormulaR1C1 = _
    "=IF(RC[-3]=""None"",0,IF(R[-3]C[-3]=""HE 495"",VLOOKUP(RC[-3],Hide!R31C18:R32C19,2,FALSE),IF(OR(R[-3]C[-3]=""HE 645"",R[-3]C[-3]=""HE 745""),VLOOKUP(RC[-3],Hide!R29C18:R30C19,2,FALSE),IF(OR(R[-3]C[-3]=""HE 986"",R[-3]C[-3]=""HE 1256"",R[-3]C[-3]=""HE 1436"",R[-3]C[-3]=""HE 1796"",R[-3]C[-3]=""HE 2066""),VLOOKUP(RC[-3],Hide!R29C20:R30C21,2,FALSE),0))))"

  • If it helps any, I inserted the formula into cell G23 and this is what it looks like
    =IF(D23="None",0,IF(D20="HE 495",VLOOKUP(D23,Hide!$R$31:$S$32,2,FALSE),IF(OR(D20="HE 645",D20="HE 745"),VLOOKUP(D23,Hide!$R$29:$S$30,2,FALSE),IF(OR(D20="HE 986",D20="HE 1256",D20="HE 1436",D20="HE 1796",D20="HE 2066"),VLOOKUP(D23,Hide!$T$29:$U$30,2,FALSE),0))))
    so syntax is OK.

  • well I was getting a runtime error and the formula is giving the wrong cells but I just lost everything about 30 mins. ago somthing happened to my excel. so you can ignore this now, I'm really sorry to waste your time like this I feel really bad. Thank you though for your help and again I'm very sorry.


    -Brian

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!