PC Review


Reply
Thread Tools Rate Thread

Clear cells in a column that contain 0

 
 
Bob Zimski
Guest
Posts: n/a
 
      23rd Jul 2009
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
 
Reply With Quote
 
 
 
 
ryguy7272
Guest
Posts: n/a
 
      23rd Jul 2009
You can see some examples of Vlookup here:
http://www.contextures.com/xlFunctions02.html

The last argument should not be False, but instead use double quotes, "".

HTH,
Ryan---

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Bob Zimski" wrote:

> 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

 
Reply With Quote
 
jasontferrell
Guest
Posts: n/a
 
      23rd Jul 2009
Maybe this is simplistic, but I would just use an if statement:
=if(vlookup(....)="", "", vlookup(....))
 
Reply With Quote
 
Bob Zimski
Guest
Posts: n/a
 
      23rd Jul 2009
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)"

"ryguy7272" wrote:

> You can see some examples of Vlookup here:
> http://www.contextures.com/xlFunctions02.html
>
> The last argument should not be False, but instead use double quotes, "".
>
> HTH,
> Ryan---
>
> --
> Ryan---
> If this information was helpful, please indicate this by clicking ''Yes''.
>
>
> "Bob Zimski" wrote:
>
> > 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

 
Reply With Quote
 
jasontferrell
Guest
Posts: n/a
 
      27th Jul 2009
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)"
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Lookup cells in one column and clear cells in another JoshW0000 Microsoft Excel Programming 5 3rd Sep 2009 03:01 PM
Display cells(text) in one column based on cells which are present inother column sunnykumar948@gmail.com Microsoft Excel Misc 1 12th May 2008 01:40 PM
Create a Clear button to clear unprotected cells Jcraig713 Microsoft Excel Programming 2 26th Nov 2007 03:55 PM
Clear cells in Column D if not = Auto =?Utf-8?B?Sk9VSU9VSQ==?= Microsoft Excel Programming 5 11th Jun 2006 01:34 PM
How do I clear a column of data without clearing specific cells? =?Utf-8?B?RWxsZW5Td2FydHM=?= Microsoft Excel Misc 2 5th Apr 2006 05:07 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:28 PM.