Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
tc tc is offline
external usenet poster
 
Posts: 40
Default Macro to Search

Hi. I need to create a macro that will search a text string in a
particular sheet and delete the entire row if the string appears

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Macro to Search

Hi,

A bit short on detail but this looks for "Mytext" in column A and if it
finds it deletes the entire row.

Sub stantial()
lastrow = Cells(Cells.Rows.Count, "A").End(xlUp).Row
For x = lastrow To 1 Step -1
Cells(x, 1).Select
If ActiveCell.Value = "Mytext" Then
Selection.EntireRow.Delete
End If
Next
End Sub

Mike

"tc" wrote:

Hi. I need to create a macro that will search a text string in a
particular sheet and delete the entire row if the string appears


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 Macro Gary Excel Discussion (Misc queries) 1 March 29th 07 04:53 PM
A Macro to search and sum SteFau Excel Programming 1 February 16th 06 03:51 PM
Trying to search web via macro - possible?? Ed Excel Programming 0 July 6th 05 07:28 PM
Excel XP VBA code to search all macro code in Excel module for specific search string criteria Ed[_18_] Excel Programming 4 May 20th 04 02:08 PM
Excel XP VBA code to search all macro code in Excel module for specific search string criteria Frank Kabel Excel Programming 0 May 19th 04 08:11 PM


All times are GMT +1. The time now is 05:06 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"