LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default if fill color = this, then increment this cell by one

Here is my first attempt

Private Sub changeColor()
Dim x As Integer
Dim y As Integer
Dim z As Integer


Set myfrange = Sheet1.Range("AI:5").Value = x
Set myyrange = Sheet1.Range("AK:5").Value = y
Set myzrange = Sheet1.Range("AK:5").Value = z


If Range("C4:af5").Cells.Interior.Color.[Red] Then x = x + 1
If Range("C4:af5").Cells.Interior.Color.[Magenta] Then y = y + 1
If Range("C4:af5").Cells.Interior.Color.[Black] Then z = z + 1

This doesn't work. Any ideas?
Thanks

 
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
How do I fill one cell color with text html/rgb color from another thewris Excel Discussion (Misc queries) 2 January 22nd 09 12:24 AM
Match TextBox Back Color to Cell Fill Color AMY Z. Excel Programming 4 October 12th 06 06:07 PM
Cell Fill Color and text color - changes for recipient Shadowman13 Excel Discussion (Misc queries) 0 March 8th 06 11:32 PM
change fill color of a range of cells based on color of a cell? DarMelNel Excel Programming 0 March 2nd 06 06:35 PM
Set Cell Fill Color Martin Excel Programming 3 September 18th 05 03:38 PM


All times are GMT +1. The time now is 08:04 PM.

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"