#1   Report Post  
Deepwater
 
Posts: n/a
Default Deleteing some Rows

I am looking for some help to delete the rows in a sheet which have some
Specific words in the cell.

For example: i have sub total for every 10 to 15 lines and would like to
find out the cell which have "sub total" word int it and delete the whole row.

Thanks in advance
  #2   Report Post  
Jason Morin
 
Posts: n/a
Default

One way:

Sub DeleteRow()
'Adapted from Microsoft code found at
'msdn.microsoft.com
Dim sFind As String
Dim Rng As Range
Dim sFindRow As Long
sFind = "*sub*total*"
Set Rng = Range("A:A").Find(What:=sFind, lookat:=xlWhole)
While Not Rng Is Nothing
sFindRow = Rng.Row
Rng.EntireRow.Delete
Set Rng = Range("A" & sFindRow - 1 & ":A" & _
Rows.Count) _
.Find(What:=sFind, lookat:=xlWhole)
Wend
End Sub

To run, press ALT+F11, go to Insert Module, and paste
in the code above. Press ALT+Q. And go to Tools Macro
Macros to run. This assumes you have data in col. A.

HTH
Jason
Atlanta, GA, USA

-----Original Message-----
I am looking for some help to delete the rows in a sheet

which have some
Specific words in the cell.

For example: i have sub total for every 10 to 15 lines

and would like to
find out the cell which have "sub total" word int it and

delete the whole row.

Thanks in advance
.

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
Insert rows based on specific value bob Excel Worksheet Functions 6 February 29th 08 07:11 PM
flexible paste rows function that inserts the right number of rows marika1981 Excel Discussion (Misc queries) 1 February 18th 05 02:40 AM
Row selections by row # OR by even/odd rows in another spreadsheet Tom Excel Discussion (Misc queries) 0 February 9th 05 04:03 PM
Adding Rows to Master Sheet Excel Newbie New Users to Excel 1 December 23rd 04 10:56 PM
Copying Rows when hiding other rows Neutron1871 Excel Worksheet Functions 2 November 3rd 04 11:38 PM


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