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: 1
Default trouble removing rows

Ok so I have a long list of data. I have 32 lines of good stuff an
then 10 bad lines, repeating for around 30000 lines. I need to remov
the 10 bad lines. I am trying to do it by looking to see if the cel
is empty or has a cetain value in it and then removes the whole row.
It doesn't run. Help please.

Sub Trash()
Dim myCell As Range, rng As Range, RW As Range
Set rng = Range("C9:C28870")

For Each myCell In rng


If IsEmpty(myCell) Then
RW = myCell.row
Rows(RW).Select
Selection.Delete Shift:=xlUp
End If

If Not IsEmpty(myCell) And myCell.Value = "grp / transactionhisto
Then
RW = myCell.row
Rows(RW).Select
Selection.Delete Shift:=xlUp
End If

Next myCell
End Su

--
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
trouble getting a formula to repeat rows FoulDwimmerlaik New Users to Excel 5 March 5th 08 10:39 PM
Trouble using macros to insert rows [email protected] Excel Discussion (Misc queries) 6 November 1st 06 04:52 PM
trouble grouping rows/columns sorielly Excel Discussion (Misc queries) 7 April 11th 06 12:56 AM
Trouble with skipping rows Wazooli Excel Worksheet Functions 1 March 23rd 05 02:19 PM
Removing Blank Rows? andycharger[_35_] Excel Programming 3 June 24th 04 02:09 AM


All times are GMT +1. The time now is 01:40 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"