VBA function VLookup and isNA RRS feed

  • Question

  • I write a vba program like this:


    set sheet = worksheets("sheet1")

    Set rng = Sheets("sheet3").Columns("A:H")


    sheet.Cells(rownumber, 1).Formula = "=IF(isNA(VLOOKUP(B" & rownumber & ",sheet3!A:H,8,0)),0,VLOOKUP(B" & rownumber & ",sheet3!A:H,8,0))"

    sheet.Cells(rownumber, 2).Value = sheet.Cells(rownumber, 1).Value



    When I run this function at first time , the value in column 1 and 2 is not equal

    But the value is the same when run more than twice.

    I was very confused.



    Thursday, June 30, 2011 6:26 AM