clear cells containing specific values

G

Guest

If someone can help me on this:
I have
column A
row1 28th street market
row2 051911 11/15/04
row3 able sewer
row4 040792 10/27/03
row5 acme awning
row6 026466 07/23/02

and so on,

i need to keep cells containing only vendor names in this column and clear
the rest, leaving them blank.

Thanks a lot for your help
 
J

JW

Does it alternate like that all the way down? Vendor name then
market? If so, here is one possibility (not tested):
Sub foofer()
lRow = Range("A65536").End(xlUp).Row
For i = 3 To lRow Step 2
Cells(i, 1).ClearContents
Next
End Sub
 
J

JW

Also, the code I poste is assuming that you have a header row.
Example:
Row 1 - Header
Row 2 - 28th Street Market
Row 3 - 051911 11/15/04

If you do not have a header row, simply change the i variable in the
For Next loop to a 2.
 
G

Guest

It does not alternate like that, i would appreciate if you have any other
idea of doing it
 
G

Guest

is there a way to create a macro that,
lets say look in column a for blank cells, and clear the contents of column b
 
J

JW

Sub foofinator()
lRow = Range("b65536").End(xlUp).Row
For i = 2 To lRow
If IsEmpty(Cells(i, 1)) Then _
Cells(i, 2).ClearContents
Next
End Sub
 
G

Guest

Thanks a lot for your help. That works perfect!

JW said:
Sub foofinator()
lRow = Range("b65536").End(xlUp).Row
For i = 2 To lRow
If IsEmpty(Cells(i, 1)) Then _
Cells(i, 2).ClearContents
Next
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top