• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Return blank cell if result is 0

Villalobos

Active Member
Hello,

I would like to ask that how is it possible return blank cell if the result of worksheet function is 0?

Code:
With Sheets("Evaluation")
Lastrow = .Cells(.Rows.count, "B").End(xlUp).Row
  .Range("AN9:AP" & Lastrow).ClearContents
  .Range("AN9:AN" & Lastrow) = WorksheetFunction.IfError(Application.VLookup(rng1, rng2.CurrentRegion, 2, False), "")
  .Range("AO9:AO" & Lastrow) = WorksheetFunction.IfError(Application.VLookup(rng1, rng2.CurrentRegion, 3, False), "")
  .Range("AP9:AP" & Lastrow) = WorksheetFunction.IfError(Application.VLookup(rng1, rng2.CurrentRegion, 4, False), "")
End With

Thank you for your help!
 
Hi ,

I am not sure but see if this works :

.Range("AN9:AN" & Lastrow).Value = Application.Evaluate("=IFERROR(VLOOKUP(" & rng1.Address & "," & rng2.CurrentRegion.Address & ",1,FALSE),"""")")

Narayan
 
Hi Narayan,

I tested the above mentioned code but doesn't work for me as I expected. Could you please see the attached file?
 

Attachments

  • sample.xlsm
    17.3 KB · Views: 3
Back
Top