Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / September 2007

Tip: Looking for answers? Try searching our database.

clear cells containing specific values

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
andresg1975 - 21 Sep 2007 20:44 GMT
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
JW - 21 Sep 2007 21:00 GMT
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

> If someone can help me on this:
> I have
[quoted text clipped - 12 lines]
>
> Thanks a lot for your help
JW - 21 Sep 2007 21:03 GMT
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.

> Does it alternate like that all the way down?  Vendor name then
> market?  If so, here is one possibility (not tested):
[quoted text clipped - 21 lines]
> >
> > Thanks a lot for your help
andresg1975 - 21 Sep 2007 21:16 GMT
It does not alternate like that, i would appreciate if you have any other
idea of doing it

> Also, the code I poste is assuming that you have a header row.
> Example:
[quoted text clipped - 30 lines]
> > >
> > > Thanks a lot for your help
JW - 21 Sep 2007 21:35 GMT
Need more info.  Need a way to identify the vendor records from the
non-vendor records.
> It does not alternate like that, i would appreciate if you have any other
> idea of doing it
[quoted text clipped - 33 lines]
> > > >
> > > > Thanks a lot for your help
andresg1975 - 21 Sep 2007 21:46 GMT
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

> Need more info.  Need a way to identify the vendor records from the
> non-vendor records.
[quoted text clipped - 35 lines]
> > > > >
> > > > > Thanks a lot for your help
JW - 21 Sep 2007 21:50 GMT
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
> 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
[quoted text clipped - 38 lines]
> > > > > >
> > > > > > Thanks a lot for your help
andresg1975 - 21 Sep 2007 22:00 GMT
Thanks a lot for your help. That works perfect!

> Sub foofinator()
>     lRow = Range("b65536").End(xlUp).Row
[quoted text clipped - 45 lines]
> > > > > > >
> > > > > > > Thanks a lot for your help
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.