ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find purple cell color, change to red (https://www.excelbanter.com/excel-programming/336046-re-find-purple-cell-color-change-red.html)

Toppers

Find purple cell color, change to red
 
Select range and the run this macro.


Sub ChangeColor()

Dim rng As Range, c As Range
'
Set rng = Selection
For Each c In rng
If c.Interior.ColorIndex = 13 Then ' Change if not correct value for
ColorIndex
c.Interior.ColorIndex = 3
End If
Next c
End Sub


HTH

"goofy11" wrote:

I'm new to VBA and am interesting in having macro that after highlighting a
range of cells, would evaluate each cell's color. For every cell that is
purple, I want it to be changed to red.

Thanks,

Jeff



All times are GMT +1. The time now is 02:30 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com