Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Quickly search for and delete entire row if certain character is found

Hello,

Im trying to find a macro that would quickly search for and delete rows
A, B, C, D and E when it finds a ! in column B. This ! exclamation mark
will be in a column with other miscelanious characters.

___A___B___C___D___E
1.|YZ |!!Z |YZ |YZ |YZ <--- exclamation mark ! found Delete A to E
2.|YZ |YZ |YZ |YZ |YZ
3.|YZ |YZ |YZ |YZ |YZ
4.|YZ |!!Z |YZ |YZ |YZ <--- exclamation mark ! found Delete A to E
5.|YZ |YZ |YZ |YZ |YZ

And so on.

Thanks,
Brian


---
Message posted from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 473
Default Quickly search for and delete entire row if certain character is found

Bkbri wrote:
Im trying to find a macro that would quickly search for and delete rows
A, B, C, D and E when it finds a ! in column B. This ! exclamation mark
will be in a column with other miscelanious characters.


With Range("A1").CurrentRegion
.AutoFilter
.AutoFilter 2, "*!*" ' show only rows where B contains !
If .Columns(1).SpecialCells(xlVisible).Count1 Then
' not just the header so there are some to delete
.Offset(1).Resize(.Rows.Count-1).SpecialCells(xlVisible).Delete _
Shift:=xlUp
End If
.AutoFilter
End With

Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - reply in newsgroup

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Quickly search for and delete entire row if certain character is found

Thank you very much it works great

--
Message posted from http://www.ExcelForum.com

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
search a row for a word and if found Vibeke Excel Worksheet Functions 2 April 16th 10 10:09 AM
reformating data- how to delete alternate blank rows quickly datamanipulator Excel Discussion (Misc queries) 4 November 27th 07 04:41 PM
Excel: Find repeated items and be able to delete quickly, option. Faith Shirley Excel Worksheet Functions 2 April 19th 06 08:07 PM
Return text found in a search Dave R. Excel Worksheet Functions 4 May 12th 05 08:53 PM
The search key was not found error Nydia New Users to Excel 0 April 27th 05 03:09 PM


All times are GMT +1. The time now is 05:40 PM.

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"