?
Solved

Excel VBA Filter using coloured cell

Posted on 2014-10-27
3
Medium Priority
?
4,403 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:Murray Brown
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 7

Accepted Solution

by:
slubek earned 1000 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 1000 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:Murray Brown
ID: 40413953
thanks
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

752 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