LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Excel VBA - Delete Rows with certain text...

Hi JMax

Try this one
http://www.rondebruin.nl/delete.htm


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"JMax " wrote in message ...
I am quite stuck to say the least. I have this file about 13K rows that
was exported from Fox Pro. In order to manipulate it, I need to delete
every (entire) row that contains the text 'Store Totals for:' At first
I thought I needed to delete every 5th row but that was not what I
needed nor did it work.....The text is in column A. Any help would be
appreciated.


Sub DeleteRows()
Dim cell As Range
Dim ICol As Integer
Dim IRow As Integer
Dim myRange As Range

ICol = Range("A1").End(xlToRight).Column
IRow = Range("A1").End(xlDown).Row
Set myRange = Range(Cells(1, 1), Cells(IRow, ICol))

For x = IRow To 2 Step -1
Set cell = Range("A" & x)
cell.Select
If cell.Value = cell.Offset(5, 0).Value Then
cell.EntireRow.Delete
End If
Next x
End Sub


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



 
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
Delete Rows Without Specific Text waggett Excel Worksheet Functions 6 October 6th 09 11:34 AM
Delete rows with certain text Pete Excel Worksheet Functions 2 July 5th 06 04:03 PM
easy way to delete all rows with no text in them? george edgar New Users to Excel 2 May 13th 06 07:54 PM
delete empty rows between rows with text Paulo Baptista Excel Discussion (Misc queries) 2 February 28th 05 03:41 PM
Delete rows that DO NOT contain certain text Steph[_3_] Excel Programming 9 January 20th 04 06:53 PM


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