Clear cells in a column that contain 0

  • Thread starter Thread starter Bob Zimski
  • Start date Start date
B

Bob Zimski

Rather than run a for.next loop on a specific column to get rid of any zeros,
is there a function that can do something like that?

Or better yet, the zero's came about from a vlookup where it found a hit,
but there was nothing to pickup so it put a zero. How can just have the
vlookup leave a blank rather than a zero in this case?

Thanks

Bob
 
Maybe this is simplistic, but I would just use an if statement:
=if(vlookup(....)="", "", vlookup(....))
 
IT works when I do it in a worksheet directly, but I think my code maybe has
a problem with the quotes as it is not working. How do I handle the double
quotes in the following?

Range("E2").Formula =
"=IF(VLOOKUP(A2,Items.csv!A:F,3,FALSE)="","",VLOOKUP(A2,Items.csv!A:F,3,FALSE)"
 
Just use two quotes for each instead of one (the first quote is the
literal identifier)
Range("E2").Formula =
"=IF(VLOOKUP(A2,Items.csv!A:F,3,FALSE)="""","""",VLOOKUP(A2,Items.csv!
A:F,3,FAL­SE)"
 
Back
Top