View Single Post
  #2   Report Post  
Old November 14th 08, 07:09 PM posted to microsoft.public.excel.misc,microsoft.public.excel.programming
Mike H Mike H is offline
external usenet poster
 
First recorded activity by ExcelBanter: Apr 2007
Posts: 11,501
Default How to replace the background color of all cells from light green

Hi,

Right click your sheet tab, view code and paste this ij and run it

Sub swapem()
For Each c In ActiveSheet.UsedRange
If c.Interior.ColorIndex = 35 Then
c.Interior.ColorIndex = 41
End If
Next
End Sub

Mike

"Claudia d'Amato" wrote:

Assume I have a worksheet where some (but not all !!) cells have a background color of light green.

How can I change at once (!) the background color of all those cells to light blue?

All other cells should remain unchanged.

Claudia