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

DataArray(Z, 2) = Cells(X, 1).Interior.ColorIndex
Cells(X, 1).Interior.ColorIndex = DataArray(Z, 2)

I go through a loop and if I execute both these lines on a cell, the
original cell color may be a light shade of purpose but after I set the color
to the same color, it is now a shade of gray! Why?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default Cell Interior Color

It looks like you might want to try the .Color property instead of .ColorIndex.

"Mike H." wrote:

DataArray(Z, 2) = Cells(X, 1).Interior.ColorIndex
Cells(X, 1).Interior.ColorIndex = DataArray(Z, 2)

I go through a loop and if I execute both these lines on a cell, the
original cell color may be a light shade of purpose but after I set the color
to the same color, it is now a shade of gray! Why?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Cell Interior Color

It didn't change appearance for me.

What was the colorindex when you started?

What version of excel are you using?

Are you sure that it isn't just that you selected the cell?

Mike H. wrote:

DataArray(Z, 2) = Cells(X, 1).Interior.ColorIndex
Cells(X, 1).Interior.ColorIndex = DataArray(Z, 2)

I go through a loop and if I execute both these lines on a cell, the
original cell color may be a light shade of purpose but after I set the color
to the same color, it is now a shade of gray! Why?


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Cell Interior Color

Your code works for me, once I wrapped some code around it. What
version of Excel are you using? You might want to post some compilable
code that illustrates the problem. Omit everything that is irrelevant,
and include code that reliably reproduces the problem.

Cordially,
Chip Pearson
Microsoft MVP 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com
[email on web site]



On Fri, 29 Jan 2010 10:39:02 -0800, Mike H.
wrote:

DataArray(Z, 2) = Cells(X, 1).Interior.ColorIndex
Cells(X, 1).Interior.ColorIndex = DataArray(Z, 2)

I go through a loop and if I execute both these lines on a cell, the
original cell color may be a light shade of purpose but after I set the color
to the same color, it is now a shade of gray! Why?

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
Cell interior color JohnB Excel Discussion (Misc queries) 4 October 12th 06 06:07 PM
Cell background color (interior color) setting not working Martin E. Excel Programming 1 May 21st 06 07:00 PM
interior color of a cell R.VENKATARAMAN Excel Programming 9 November 11th 05 04:15 AM
Interior Cell color Pellechi Excel Programming 1 September 23rd 03 03:39 PM


All times are GMT +1. The time now is 11:21 AM.

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"