2
I have this bit of code:
Range("F8").Select
For Each m In Range(Range("C8"), Range("C" & rows.Count).End(xlUp))
If ActiveCell.Offset(0, 0) <> " " Then
ActiveCell.Offset(0, 7) = Application.vlookup(ActiveCell, Sheets("Chargeback code-Pursuit").Range("A2:B20000"), 2, False)
ActiveCell.Offset(1, 0).Select
End If
Next
And when doing this the desired data appears, but qd cell C8 is empty the field that is filling with vlookup is showing as #N/A.
How do I make Cells that contain #N/A become Blank Cells?
Below is the #N/A example
Thanks for the help.
Thanks for the help, but this not working @virtualdvid gives sub or Function not defined error :S
– Ricardo Gonçalves
Sorry my mistake, the problem is because the
vlookup
is not a VBA resource. I corrected my answer, tell me if it works :)– virtualdvid
To do this I have to put the function on a certain sheet? Because currently of the error of Unable to get the Vlookup Property of the Worksheetfunction class
– Ricardo Gonçalves
Try the
Application.WorksheetFunction.VLookup(arg1,arg2,arg2,[arg4])
– danieltakeshi
You want the formula or just the value in the cell?
– virtualdvid
As it is in the code that I showed works, only that I can not avoid the #N/A and that is only what I intend to do.
– Ricardo Gonçalves
You try the first line of my answer?
Application.iferror(Application.vlookup(
– virtualdvid
Yes, and gave Sub or Function not defined error
– Ricardo Gonçalves
I ran that line was missing
Application.
in thevlookup
you can try again with this line. I am also working on another possible response. I will update my response soon.– virtualdvid
The second option does not pass here Then Activecell.Offset(0, 7) = " " is normal? continues to give #N/A
– Ricardo Gonçalves
I was able to resolve: [ For Each M In Range(Range("C8"), Range("C" & Rows.Count).End(xlUp)) Activecell.Offset(0, 7) = Application.vlookup(Activecell, Sheets("Chargeback code-Pursuit").Range("A2:B20000"), 2, False) Activecell.Offset(1, 0). Select If Iserror(Activecell.Offset(0, 7)) Then Activecell.Offset(0, 7) = "" Next Cells.Replace "#N/A", """, xlWhole]
– Ricardo Gonçalves