Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,117
Default How to replace the background color of all cells from light greento light blue?

try this macro - change the range to suit your range. NOTE: this
will not work if the cells that are green are green because of
conditional formatting!!!! this will only work if they have been
manually colored. if you have conditional formatting involved, you
will need something different.

'--------------------------------------------------------------------------
Sub change_color()

Dim myWS As Worksheet
Dim c As Range
Dim myRange As Range

Set myWS = ActiveSheet
Set myRange = ws.Range("a1:g500") '<--CHANGE RANGE

For Each c In myRange
If c.Interior.ColorIndex = 35 Then 'green
c.Interior.ColorIndex = 34 'blue
End If
Next c

End Sub
'------------------------------------------------------------------------

hope that helps!
:)
susan



On Nov 14, 1:54*pm, (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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,117
Default How to replace the background color of all cells from light greento light blue?

TYPO ALERT


Set myRange = ws.Range("a1:g500") '<--CHANGE RANGE

should be

Set myRange = myWS.Range("a1:g500") '<--CHANGE RANGE

susan


On Nov 14, 2:02*pm, Susan wrote:
try this macro - change the range to suit your range. *NOTE: *this
will not work if the cells that are green are green because of
conditional formatting!!!! *this will only work if they have been
manually colored. *if you have conditional formatting involved, you
will need something different.

'--------------------------------------------------------------------------
Sub change_color()

Dim myWS As Worksheet
Dim c As Range
Dim myRange As Range

Set myWS = ActiveSheet
Set myRange = ws.Range("a1:g500") *'<--CHANGE RANGE

For Each c In myRange
* *If c.Interior.ColorIndex = 35 Then *'green
* * * c.Interior.ColorIndex = 34 *'blue
* *End If
Next c

End Sub
'------------------------------------------------------------------------

hope that helps!
:)
susan

On Nov 14, 1:54*pm, (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- Hide quoted text -


- Show quoted text -


  #4   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
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


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default How to replace the background color of all cells from light green to light blue?

How did those cells get their light green color? Was it from a Conditional
Format or did you manually set their color.

--
Rick (MVP - Excel)


"Claudia d'Amato" wrote in message
...
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




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default How to replace the background color of all cells from light green to light blue?

Select all cells the EditFindOptionsFormatFormat

Pick the light green color from the Patterns Tab and OkFind All.

Select top cell in the "found" dialog box. SHIFT + End and Downarrow

On main menu, FormatCellsPattern.......pick light blue and OK.


Gord Dibben MS Excel MVP

On 14 Nov 2008 18:54:25 GMT, (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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007 noncontiguous cell highlight color=light,light blue. How do I make it darker, or like Excel 2003 ( I'm extremely shade blind-PLZ HELP !! ) DCJM New Users to Excel 1 July 28th 11 12:49 PM
Excel 2007 noncontiguous cell highlight color=light,light blue. How do I make it darker, or like Excel 2003 ( I'm extremely shade blind-PLZ HELP !! ) DCJM Excel Discussion (Misc queries) 1 July 27th 11 10:42 PM
How to replace the background color of all cells from light green to light blue? Claudia d'Amato Excel Discussion (Misc queries) 1 November 14th 08 07:09 PM
I need to add a blinking red, yellow and green light to an excel Becke Wolf Excel Discussion (Misc queries) 1 April 30th 07 11:32 PM
sheet background color suddenly changed to light green from normal Dan Excel Discussion (Misc queries) 0 March 28th 07 03:22 PM


All times are GMT +1. The time now is 01:15 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"