A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

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



 
 
Thread Tools Display Modes
  #1  
Old November 19th, 2009, 11:27 PM posted to microsoft.public.excel.misc
Doug[_15_]
external usenet poster
 
Posts: 5
Default How to Delete entire rows by selecting different text in column A

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
  #2  
Old November 20th, 2009, 12:59 AM posted to microsoft.public.excel.misc
Dave Peterson
external usenet poster
 
Posts: 19,791
Default How to Delete entire rows by selecting different text in column A

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
  #3  
Old November 20th, 2009, 02:03 PM posted to microsoft.public.excel.misc
Doug[_15_]
external usenet poster
 
Posts: 5
Default How to Delete entire rows by selecting different text in colum

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
.

 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:24 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.