PC Review


Reply
Thread Tools Rate Thread

clear cells containing specific values

 
 
=?Utf-8?B?YW5kcmVzZzE5NzU=?=
Guest
Posts: n/a
 
      21st Sep 2007
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
 
Reply With Quote
 
 
 
 
JW
Guest
Posts: n/a
 
      21st Sep 2007
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

andresg1975 wrote:
> 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


 
Reply With Quote
 
JW
Guest
Posts: n/a
 
      21st Sep 2007
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.


JW wrote:
> 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
>
> andresg1975 wrote:
> > 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


 
Reply With Quote
 
=?Utf-8?B?YW5kcmVzZzE5NzU=?=
Guest
Posts: n/a
 
      21st Sep 2007
It does not alternate like that, i would appreciate if you have any other
idea of doing it

"JW" wrote:

> 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.
>
>
> JW wrote:
> > 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
> >
> > andresg1975 wrote:
> > > 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

>
>

 
Reply With Quote
 
JW
Guest
Posts: n/a
 
      21st Sep 2007
Need more info. Need a way to identify the vendor records from the
non-vendor records.
andresg1975 wrote:
> It does not alternate like that, i would appreciate if you have any other
> idea of doing it
>
> "JW" wrote:
>
> > 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.
> >
> >
> > JW wrote:
> > > 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
> > >
> > > andresg1975 wrote:
> > > > 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

> >
> >


 
Reply With Quote
 
=?Utf-8?B?YW5kcmVzZzE5NzU=?=
Guest
Posts: n/a
 
      21st Sep 2007
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


"JW" wrote:

> Need more info. Need a way to identify the vendor records from the
> non-vendor records.
> andresg1975 wrote:
> > It does not alternate like that, i would appreciate if you have any other
> > idea of doing it
> >
> > "JW" wrote:
> >
> > > 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.
> > >
> > >
> > > JW wrote:
> > > > 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
> > > >
> > > > andresg1975 wrote:
> > > > > 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
> > >
> > >

>
>

 
Reply With Quote
 
JW
Guest
Posts: n/a
 
      21st Sep 2007
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
andresg1975 wrote:
> 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
>
>
> "JW" wrote:
>
> > Need more info. Need a way to identify the vendor records from the
> > non-vendor records.
> > andresg1975 wrote:
> > > It does not alternate like that, i would appreciate if you have any other
> > > idea of doing it
> > >
> > > "JW" wrote:
> > >
> > > > 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.
> > > >
> > > >
> > > > JW wrote:
> > > > > 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
> > > > >
> > > > > andresg1975 wrote:
> > > > > > 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
> > > >
> > > >

> >
> >


 
Reply With Quote
 
=?Utf-8?B?YW5kcmVzZzE5NzU=?=
Guest
Posts: n/a
 
      21st Sep 2007
Thanks a lot for your help. That works perfect!

"JW" wrote:

> 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
> andresg1975 wrote:
> > 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
> >
> >
> > "JW" wrote:
> >
> > > Need more info. Need a way to identify the vendor records from the
> > > non-vendor records.
> > > andresg1975 wrote:
> > > > It does not alternate like that, i would appreciate if you have any other
> > > > idea of doing it
> > > >
> > > > "JW" wrote:
> > > >
> > > > > 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.
> > > > >
> > > > >
> > > > > JW wrote:
> > > > > > 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
> > > > > >
> > > > > > andresg1975 wrote:
> > > > > > > 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
> > > > >
> > > > >
> > >
> > >

>
>

 
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
Clear Contents of Specific Cells in Last Row Steve Microsoft Excel Programming 2 16th Mar 2009 10:18 PM
clear specific cells in a form vdmbqb Microsoft Excel Misc 1 24th Nov 2007 08:07 PM
Clear UsedRange except specific cells? Ray Microsoft Excel Programming 6 7th Aug 2007 12:26 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
Count cells with specific values in the cells next to them? =?Utf-8?B?Q2hyaXN0b3BoZXI=?= Microsoft Excel Worksheet Functions 2 8th Sep 2005 05:49 PM


Features
 

Advertising
 

Newsgroups
 


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