Filter but both color AND Text

R

Regalibar

Hi All,

Is there a way to filter columns by both color and text? Some rows have
color some rows have text (Y/N). And I need to filter out all the gray cells
and the cells with "Y"

regards

Reginald
 
S

Shane Devenshire

Hi,

The trick to doing this is to create a second column which refers to the Y,
N and then apply the filter using both columns:

Suppose your Y/N color column is A1:A100 with titles on the first row, in B1
enter "Dummy" and in B2 enter
=A2
Copy this down.
Apply the filter to both columns. From the column A filter pick Color is
Gray. From the column B filter pick Y.
 
C

Chris Bode

Well, you can achieve this task using macro
Add a command button on the sheet from the control box and past
following codes in codes window

Code
-------------------

Private Sub CommandButton1_Click()
Dim row As Integer, col As Integer
row = 1
col = 1


For row = 1 To 10
If Sheet1.Cells(row, col).Interior.Color = 12632256 Then
Exit Sub
ElseIf Sheet1.Cells(row, col).Value = "Y" Or Sheet1.Cells(row, col).Value = "N" Then
Exit Sub
Else
Sheet1.Rows(row).Delete
End If
Next

End Sub

-------------------




Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top