Solved

Excel VBA Filter using coloured cell

Posted on 2014-10-27
3
1,833 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now