display cells with fill colour

martinsimart

New Member
Joined
Mar 23, 2018
Messages
9
Hi

I have a spreadsheet that colours cells yellow if they have a duplicate name listed in next column

as the column is long (500 rows)I was hoping that there was vba code to copy the small number of cells with fill colour and automatically paste them in another column so i can see them quickly

I know i could filter by colour but I am intrigued (lazy) to see if it can be done

Thanks
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Hi,
Why don't you consider vba colour filtering instead of copying data? Check this out, it works for column A and color yellow. If you want to change either column or color adjust below range for columns and for color you can use the following statemeng RGB(255,255,0) [set your rgb color] instead of constant color values as vbyellow.

Code:
Sub ColorFiltering()
Dim rng as range

set rng =range"A1:A500"
ActiveSheet.rng.autofilter field:=1, Criteria1:=vbYellow, operator:=xlFilterCellColor

Set rng =nothing
End sub
 
Upvote 0

Forum statistics

Threads
1,223,952
Messages
6,175,594
Members
452,654
Latest member
mememe101

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