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: 102
Default Copying the colors of one Matrix to Another?!

Hi everyone,

Say I have a matrix:

2 5
4 1
2 2
4 4
3 2

The following piece of code will color each cell in that matrix:

Dim RngA As Range
Dim RngAInput As Variant

Set RngAInput = Range("B3:c7")
For Each RngA In RngAInput
'Determine the color
Select Case RngA.Value
Case Is = 4: Num = 40
Case Is = 2: Num = 35
Case Is = "": Num = 2
End Select
RngA.Interior.ColorIndex = Num
RngA.Font.ColorIndex = 1
Next RngA

Note that for values of 1, 3, and 5, Conditional Formatting is used
(this is why they are excluded in the code).

NOW, say I have identical blank matrix, Range("b19:c23"), that I want
to copy to it the colors of the above one.

What changes I need to make to the above code to make this happen?

Thanks alot,
Mike

 
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
Used drawing colors in shapes....lost default colors for "Fill Col Lai704 Excel Discussion (Misc queries) 1 August 20th 08 04:45 AM
How can I transpose nXm matrix to mXn Matrix MIHir Excel Worksheet Functions 2 August 9th 08 11:44 AM
Lost highlighting and font colors; background colors on web pages Jan in Raleigh Excel Discussion (Misc queries) 2 July 31st 07 09:10 PM
Cell fill colors in Excel change when copying to a new book jkbond67 Excel Discussion (Misc queries) 2 July 31st 06 09:47 PM
Why cell colors change when copying/moving kdw Excel Programming 3 November 6th 04 12:53 AM


All times are GMT +1. The time now is 08:33 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"