Solved

Excel VBA Filter using coloured cell

Posted on 2014-10-27
3
2,449 Views
Last Modified: 2014-10-30
Hi

I have an excel spreadsheet where the first cell is coloured yellow if the row has been changed.
What VBA code would I use to filter the spreadsheet so that only rows where the first cell is yellow
are shown in my data range
0
Comment
Question by:murbro
3 Comments
 
LVL 7

Accepted Solution

by:
slubek earned 250 total points
ID: 40405883
Why don't you use Filter by color option?
The code in VBA:
    ActiveSheet.Range("$A$1:$A$6").AutoFilter Field:=1, Criteria1:=RGB(255, 255, _
        0), Operator:=xlFilterFontColor

Open in new window

0
 
LVL 12

Assisted Solution

by:sdwalker
sdwalker earned 250 total points
ID: 40407145
Assuming your header is in Row 1 (you have to have a header to use a filter), you would use the Operator xlFilterCellColor

   ActiveSheet.Range("A1:A40").AutoFilter Field:=1, Criteria1:=RGB(255, 255, _
        0), Operator:=xlFilterCellColor
 

Open in new window

0
 

Author Closing Comment

by:murbro
ID: 40413953
thanks
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question