ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How to replace the background color of all cells from light green to light blue? (https://www.excelbanter.com/excel-discussion-misc-queries/210338-how-replace-background-color-all-cells-light-green-light-blue.html)

Claudia d'Amato November 14th 08 06:54 PM

How to replace the background color of all cells from light green to light blue?
 
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


Mike H November 14th 08 07:09 PM

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




All times are GMT +1. The time now is 10:28 PM.

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