PC Review


Reply
Thread Tools Rate Thread

How to Delete entire rows by selecting different text in column A

 
 
Doug
Guest
Posts: n/a
 
      19th Nov 2009
I have a database that exports data to excel where duplicate and specific
data is deleted using macros.
My question is the data in column A uses multiple years of information.
Example

2009 2 Man Fall Senior Team Beall
2009 2 Man Fall Senior Team Beeghly
2008 2 Man Fall Senior Team Berish
2009 2 Man Fall Senior Team Blohm
2008 2 Man Fall Senior Team Brander
2008 2 Man Fall Senior Team Brown

Using the If function how do I either just use part of the cell, e.g. "Fall
Senior" or use the entire cell e.g. 2008 2 Man Fall Senior Team but use a
wild card character for the year e.g. 20?? 2 Man Fall Senior Team to delete
the entire row?

Any help would be appreciated.



--
Doug
Small Business Databases
 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      20th Nov 2009
You could use Like:
if ucase(mycell.value) like "*" & ucase("fall senior") & "*") then
if ucase(mycell.value) like ucase("20?? 2 Man Fall Senior Team") then

The asterisk represents 0 to lots of characters. The ? is a single character.


or you could use instr():
if instr(1, mycell.value, "fall senior", vbtextcompare) > 0 then





Doug wrote:
>
> I have a database that exports data to excel where duplicate and specific
> data is deleted using macros.
> My question is the data in column A uses multiple years of information.
> Example
>
> 2009 2 Man Fall Senior Team Beall
> 2009 2 Man Fall Senior Team Beeghly
> 2008 2 Man Fall Senior Team Berish
> 2009 2 Man Fall Senior Team Blohm
> 2008 2 Man Fall Senior Team Brander
> 2008 2 Man Fall Senior Team Brown
>
> Using the If function how do I either just use part of the cell, e.g. "Fall
> Senior" or use the entire cell e.g. 2008 2 Man Fall Senior Team but use a
> wild card character for the year e.g. 20?? 2 Man Fall Senior Team to delete
> the entire row?
>
> Any help would be appreciated.
>
> --
> Doug
> Small Business Databases


--

Dave Peterson
 
Reply With Quote
 
Doug
Guest
Posts: n/a
 
      20th Nov 2009
thanks Dave
either way works great
--
Doug
Small Business Databases


"Dave Peterson" wrote:

> You could use Like:
> if ucase(mycell.value) like "*" & ucase("fall senior") & "*") then
> if ucase(mycell.value) like ucase("20?? 2 Man Fall Senior Team") then
>
> The asterisk represents 0 to lots of characters. The ? is a single character.
>
>
> or you could use instr():
> if instr(1, mycell.value, "fall senior", vbtextcompare) > 0 then
>
>
>
>
>
> Doug wrote:
> >
> > I have a database that exports data to excel where duplicate and specific
> > data is deleted using macros.
> > My question is the data in column A uses multiple years of information.
> > Example
> >
> > 2009 2 Man Fall Senior Team Beall
> > 2009 2 Man Fall Senior Team Beeghly
> > 2008 2 Man Fall Senior Team Berish
> > 2009 2 Man Fall Senior Team Blohm
> > 2008 2 Man Fall Senior Team Brander
> > 2008 2 Man Fall Senior Team Brown
> >
> > Using the If function how do I either just use part of the cell, e.g. "Fall
> > Senior" or use the entire cell e.g. 2008 2 Man Fall Senior Team but use a
> > wild card character for the year e.g. 20?? 2 Man Fall Senior Team to delete
> > the entire row?
> >
> > Any help would be appreciated.
> >
> > --
> > Doug
> > Small Business Databases

>
> --
>
> Dave Peterson
> .
>

 
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
Need a Marco to find and delete an entire column based on text sea Rockpaw Microsoft Excel Programming 1 29th May 2008 08:12 AM
Delete entire rows where there is a blank in column A Chris Hankin Microsoft Excel Programming 7 11th Jun 2006 09:56 AM
Delete all rows where Column A contains Text =?Utf-8?B?RCBIYWZlciAtIFRGRQ==?= Microsoft Excel Worksheet Functions 3 1st Jul 2005 06:03 PM
Color Entire Rows depending on Text in Column A Rashid Khan Microsoft Excel Programming 3 23rd Dec 2004 05:06 PM
macro to delete entire rows when column A is blank ...a quick macro vikram Microsoft Excel Programming 4 3rd May 2004 08:45 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:29 PM.