Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Change Cell color

Could someone please show me the code, I still have trouble setting up a
simple loop.
I have tried to adapt other code I have, but no luck.

In a range E75:T100

If the cells in F75 to T75 have a colorindex value of xlNone then
Cell E75 has a colorindex value = 5

Do the next row

Thank you


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Change Cell color

This is NOT as simple a problem as it sounds. If you scroll down to an
earlier thread in this newsgroup with the subject line "Colorindex"
(original message posted on September 22nd), you will an alternating
sub-thread between Jacob and myself where we still haven't ironed out all
the wrinkles for a generalized "retrieve the Conditional Formatting
ColorIndex value currently in effect". If you continue to follow that
thread, I'm sure a complete solution will eventually be posted.

--
Rick (MVP - Excel)


"CR" wrote in message
m...
Could someone please show me the code, I still have trouble setting up a
simple loop.
I have tried to adapt other code I have, but no luck.

In a range E75:T100

If the cells in F75 to T75 have a colorindex value of xlNone then
Cell E75 has a colorindex value = 5

Do the next row

Thank you


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Change Cell color

Hi,

Maybe this

Sub CheckColour()
For Each c In Range("F75:F100")
If c.Resize(, 15).Interior.ColorIndex = xlNone Then
c.Offset(, -1).Interior.ColorIndex = 5
End If
Next
End Sub

Mike

"CR" wrote:

Could someone please show me the code, I still have trouble setting up a
simple loop.
I have tried to adapt other code I have, but no luck.

In a range E75:T100

If the cells in F75 to T75 have a colorindex value of xlNone then
Cell E75 has a colorindex value = 5

Do the next row

Thank you



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Change Cell color

Rick,

I'm not sure the OP is referring to CF colours here. With regard to the
other thread doesn't Bob Philips' code do what that OP wanted

http://www.xldynamic.com/source/xld.CFConditions.html


Mike

"Rick Rothstein" wrote:

This is NOT as simple a problem as it sounds. If you scroll down to an
earlier thread in this newsgroup with the subject line "Colorindex"
(original message posted on September 22nd), you will an alternating
sub-thread between Jacob and myself where we still haven't ironed out all
the wrinkles for a generalized "retrieve the Conditional Formatting
ColorIndex value currently in effect". If you continue to follow that
thread, I'm sure a complete solution will eventually be posted.

--
Rick (MVP - Excel)


"CR" wrote in message
m...
Could someone please show me the code, I still have trouble setting up a
simple loop.
I have tried to adapt other code I have, but no luck.

In a range E75:T100

If the cells in F75 to T75 have a colorindex value of xlNone then
Cell E75 has a colorindex value = 5

Do the next row

Thank you



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Change Cell color

The Color index is not Conditional formatting.

Mike, It does not seem to work as planned.
I looks like it is offsetting -1 from the first cell that has xlNone, not
from the first cell in the row.
The cell directly next to every cell that is xlNone gets the new color
index.

CR



"Mike H" wrote in message
...
Hi,

Maybe this

Sub CheckColour()
For Each c In Range("F75:F100")
If c.Resize(, 15).Interior.ColorIndex = xlNone Then
c.Offset(, -1).Interior.ColorIndex = 5
End If
Next
End Sub

Mike

"CR" wrote:

Could someone please show me the code, I still have trouble setting up a
simple loop.
I have tried to adapt other code I have, but no luck.

In a range E75:T100

If the cells in F75 to T75 have a colorindex value of xlNone then
Cell E75 has a colorindex value = 5

Do the next row

Thank you







  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Change Cell color

Mike, I'm sorry. I forgot to say that All of the cells in the row have to
have xlNone before the first one's color index is changed. Once it finds a
cell with a different color it can go to the next row.

CR



"CR" wrote in message
...
The Color index is not Conditional formatting.

Mike, It does not seem to work as planned.
I looks like it is offsetting -1 from the first cell that has xlNone, not
from the first cell in the row.
The cell directly next to every cell that is xlNone gets the new color
index.

CR



"Mike H" wrote in message
...
Hi,

Maybe this

Sub CheckColour()
For Each c In Range("F75:F100")
If c.Resize(, 15).Interior.ColorIndex = xlNone Then
c.Offset(, -1).Interior.ColorIndex = 5
End If
Next
End Sub

Mike

"CR" wrote:

Could someone please show me the code, I still have trouble setting up a
simple loop.
I have tried to adapt other code I have, but no luck.

In a range E75:T100

If the cells in F75 to T75 have a colorindex value of xlNone then
Cell E75 has a colorindex value = 5

Do the next row

Thank you







  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Change Cell color

Hi,

The macro reads down column F and if all the cells to the right of that
including column F as far as column T are XLnone it colours column E. If
that's not what you want I don't understand. Perhaps ypu could clarify some
more.

Mike

"CR" wrote:

Mike, I'm sorry. I forgot to say that All of the cells in the row have to
have xlNone before the first one's color index is changed. Once it finds a
cell with a different color it can go to the next row.

CR



"CR" wrote in message
...
The Color index is not Conditional formatting.

Mike, It does not seem to work as planned.
I looks like it is offsetting -1 from the first cell that has xlNone, not
from the first cell in the row.
The cell directly next to every cell that is xlNone gets the new color
index.

CR



"Mike H" wrote in message
...
Hi,

Maybe this

Sub CheckColour()
For Each c In Range("F75:F100")
If c.Resize(, 15).Interior.ColorIndex = xlNone Then
c.Offset(, -1).Interior.ColorIndex = 5
End If
Next
End Sub

Mike

"CR" wrote:

Could someone please show me the code, I still have trouble setting up a
simple loop.
I have tried to adapt other code I have, but no luck.

In a range E75:T100

If the cells in F75 to T75 have a colorindex value of xlNone then
Cell E75 has a colorindex value = 5

Do the next row

Thank you








  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Change Cell color

Mike, It does work.

My bad. I changed the Range and botched that. After I fixed that, None of
the rows had all xlNone cells so I didn't think it was working.

Sorry for the problem.

Thank you for your time.

Coy


"Mike H" wrote in message
...
Hi,

The macro reads down column F and if all the cells to the right of that
including column F as far as column T are XLnone it colours column E. If
that's not what you want I don't understand. Perhaps ypu could clarify
some
more.

Mike

"CR" wrote:

Mike, I'm sorry. I forgot to say that All of the cells in the row have to
have xlNone before the first one's color index is changed. Once it finds
a
cell with a different color it can go to the next row.

CR



"CR" wrote in message
...
The Color index is not Conditional formatting.

Mike, It does not seem to work as planned.
I looks like it is offsetting -1 from the first cell that has xlNone,
not
from the first cell in the row.
The cell directly next to every cell that is xlNone gets the new color
index.

CR



"Mike H" wrote in message
...
Hi,

Maybe this

Sub CheckColour()
For Each c In Range("F75:F100")
If c.Resize(, 15).Interior.ColorIndex = xlNone Then
c.Offset(, -1).Interior.ColorIndex = 5
End If
Next
End Sub

Mike

"CR" wrote:

Could someone please show me the code, I still have trouble setting
up a
simple loop.
I have tried to adapt other code I have, but no luck.

In a range E75:T100

If the cells in F75 to T75 have a colorindex value of xlNone then
Cell E75 has a colorindex value = 5

Do the next row

Thank you










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
Macro to change color of tab based on color of cell Amie Excel Programming 5 June 23rd 08 08:45 PM
Excel: Syntax to change cell color based on color of another cell davew18 Excel Worksheet Functions 1 January 4th 07 01:24 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
How to change the default Border, Font Color, and Cell Color Elijah Excel Discussion (Misc queries) 3 November 2nd 05 11:52 PM
Browse Forms Controls and change TextBox color based on cell color StefanW Excel Programming 2 November 21st 04 07:06 PM


All times are GMT +1. The time now is 09:07 PM.

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

About Us

"It's about Microsoft Excel"