Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Find the word "total" in a cell, delete row or column


Hi, I need help. Is it possible to search for the word "total" in an
cell on the active Excel worksheet, then delete the entire row and/o
column where "total" exists ?
Any help is appreciated. Thanks :

--
Lawler
-----------------------------------------------------------------------
Lawlerd's Profile: http://www.excelforum.com/member.php...fo&userid=1547
View this thread: http://www.excelforum.com/showthread.php?threadid=27057

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Find the word "total" in a cell, delete row or column

Hi Lawlerd, this code was posted by Frank Kabel, it should do what you
you need, it will delete every row with the word 'total' in column A...

Sub delete_rows()
Dim RowNdx As Long
Dim LastRow As Long
LastRow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).row
For RowNdx = LastRow To 1 Step -1
If Cells(RowNdx, "A").Value = "total" Then
Rows(RowNdx).Delete
End If
Next RowNdx
End Sub

ste
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
"Last Cell" to find last row, but can't delete blank rows [email protected] Excel Discussion (Misc queries) 6 January 8th 07 11:50 PM
possible? =if(That cell = "a certain word", delete row, go next) Jim Excel Discussion (Misc queries) 2 February 27th 06 08:39 PM
Search "Total" in all worksheets and delete rows containing "Total" mk_garg20 Excel Programming 2 July 30th 04 06:42 AM
Delete find "Grand Total" Sue Harsevoort Excel Programming 0 February 27th 04 05:20 PM
Delete find "Grand Total" Medemper Excel Programming 0 February 27th 04 04:53 PM


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