Extract multiple data from cells in a range based on cell color

daviskeas

New Member
Joined
Dec 19, 2018
Messages
4
Screenshot%202018-12-19%2001.56.35.png
i want to take the data in the range C12:K20 and extract only the green colored cells into a list under A1.




https://www.dropbox.com/s/51phis2d5cb36ko/Screenshot%202018-12-19%2001.56.35.png?dl=0
Screenshot%202018-12-19%2001.56.35.png
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Try
Code:
Sub daviskeas()
   Dim Cl As Range
   
   For Each Cl In Range("C12:K20")
      If Cl.Interior.Color = Range("A1").Interior.Color Then
         Cl.Copy Range("A" & Rows.Count).End(xlUp).Offset(1)
      End If
   Next Cl
End Sub
Cell A1 needs to have the colour fill that you are looking for.
 
Upvote 0
It doesn't do anything when I enter this into VB. Do I need to do something on the spreadsheet to make it run something. Sorry I am very new to this and not sure. Thanks for you help.
 
Upvote 0
To run the code use
Alt F8 > select the macro > click "run"
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,215,034
Messages
6,122,782
Members
449,095
Latest member
m_smith_solihull

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top