Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
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
.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I delete blank rows from excel without selecting them? rgtest Excel Worksheet Functions 9 February 14th 09 03:12 PM
Keyboard shortcut or selecting entire column Precious_Stone Excel Worksheet Functions 2 July 18th 06 05:37 PM
CANNOT DELETE AN ENTIRE COLUMN ibeetb Excel Discussion (Misc queries) 4 June 23rd 06 02:55 AM
Hide/Delete entire rows based in the content of one cell Clueless Excel Discussion (Misc queries) 2 October 3rd 05 02:40 PM
Delete all rows where Column A contains Text D Hafer - TFE Excel Worksheet Functions 3 July 1st 05 06:03 PM


All times are GMT +1. The time now is 10:06 AM.

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

About Us

"It's about Microsoft Excel"