ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Deletion of rows according to background color (https://www.excelbanter.com/excel-programming/301898-deletion-rows-according-background-color.html)

Salim

Deletion of rows according to background color
 
I have an excelsheet wherby rows having different
background colors. How can i select certain background
color and delet the remaining.
Thanks

Bob Phillips[_6_]

Deletion of rows according to background color
 
Salim,

You could do it this way

write a UDF to determine the ColoIndex of a cell
in the adjacent column, use the UDF to get the Colorindex
filter on this column
select not equal to hour value
Delet visible rows

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"salim" wrote in message
...
I have an excelsheet wherby rows having different
background colors. How can i select certain background
color and delet the remaining.
Thanks




No Name

Deletion of rows according to background color
 
To Me it looks like headlines can you please elaborate
Thanks
-----Original Message-----
Salim,

You could do it this way

write a UDF to determine the ColoIndex of a cell
in the adjacent column, use the UDF to get the Colorindex
filter on this column
select not equal to hour value
Delet visible rows

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"salim" wrote in

message
...
I have an excelsheet wherby rows having different
background colors. How can i select certain background
color and delet the remaining.
Thanks



.


Tom Ogilvy

Deletion of rows according to background color
 
Here is an additional approach:
assume the colors are at least in column A

Sub DeleteColor()
Dim rng As Range, LastRow As Long
Dim i As Long
Set rng = ActiveSheet.UsedRange.Columns(1).Cells
LastRow = rng(rng.Count).Row
For i = LastRow To 1 Step -1
idex = Cells(i, 1).Interior.ColorIndex
Select Case idex
Case 3, 8, 9, 21
Cells(i, 1).EntireRow.Delete
End Select
Next
End Sub


--
Regards,
Tom Ogilvy




wrote in message
...
To Me it looks like headlines can you please elaborate
Thanks
-----Original Message-----
Salim,

You could do it this way

write a UDF to determine the ColoIndex of a cell
in the adjacent column, use the UDF to get the Colorindex
filter on this column
select not equal to hour value
Delet visible rows

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"salim" wrote in

message
...
I have an excelsheet wherby rows having different
background colors. How can i select certain background
color and delet the remaining.
Thanks



.





All times are GMT +1. The time now is 06:10 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com