Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Contional Row Delete on Interior Color

Newbie looking for some help..
I have a spreadsheet of unknown row length. I have a macro which uses various logic statements to format, sort and qualify row items. Problem rows contain cells formatted in a yellow color when suspicious data appears

I need a method to delete rows which have only all white interior cells formatting, thus leaving any row with at least one yellow formatted cell.

I use the following technique for most of the conditional actions

Dim s As Lon
With Worksheets("Jobs"
For s = .UsedRange.Rows.Count To 2 Step -
If .Cells(s, "B").Value < "#104" Then .Rows(s).Delet
Nex
End Wit

Any suggestions are appreciated
Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Contional Row Delete on Interior Color

Alright Newb,
Here’s the deal. With “UsedRange.Rows.Count” you can only count on i
giving you the correct result if there are no empty rows at the top o
your worksheet. Instead, use this:

.UsedRange.Row - 1 + .UsedRange.Rows.Count

That will always work.

So try this, but be sure to change the "10" in "For c = 1 To 10" t
the number of columns you're concerned with:
With Worksheets(“Jobs”)
x = .UsedRange.Row - 1 + .UsedRange.Rows.Count
For r = x To 2 Step -1
keep = False
For c = 1 To 10
If .Cells(r, c).Interior.ColorIndex = 6 Then
keep = True
End If
Next c
If keep = False Then
.Rows(r).Delete
End If
Next r
End Wit

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Contional Row Delete on Interior Color

So obvious once seen. Yes I get it

Thanks so much for your help
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
No Interior Color Macro simplymidori[_2_] Excel Discussion (Misc queries) 1 April 11th 08 05:01 AM
Cell interior color JohnB Excel Discussion (Misc queries) 4 October 12th 06 06:07 PM
Print without Interior Color bhofsetz Excel Discussion (Misc queries) 2 July 19th 05 04:28 PM
oRange.Interior.Color Vasant Nanavati[_2_] Excel Programming 3 July 13th 03 08:28 AM


All times are GMT +1. The time now is 07:05 PM.

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"