Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Worksheet Functions / March 2008

Tip: Looking for answers? Try searching our database.

filter the rows which is having the colored text

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
manoj - 10 Mar 2008 09:47 GMT
I have a set of 310,000 rows which I recieved from somebody and I want to
delete the rows which is having colored text

Can I filter the rows which is having colored text and then delete it
completely??

pls suggest some steps

regards
MAnoj
Mike H - 10 Mar 2008 13:43 GMT
Right click the sheet tab, view code and paste this in. It looks for red text
on column A and deletes the entire row if it finds it

Sub delete_Me()
Dim copyrange As Range
lastrow = Cells(Cells.Rows.Count, "A").End(xlUp).Row
Set myrange = Range("A1:A" & lastrow)
For Each c In myrange
   If c.Font.ColorIndex = 3 Then 'Red change to suit
       If copyrange Is Nothing Then
               Set copyrange = c.EntireRow
       Else
               Set copyrange = Union(copyrange, c.EntireRow)
       End If
   End If
Next
copyrange.Delete
End Sub

Mike

> I have a set of 310,000 rows which I recieved from somebody and I want to
> delete the rows which is having colored text
[quoted text clipped - 6 lines]
> regards
> MAnoj
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.