Correct Colour In Excel Documents..

Hi,

I posted this elsewhere & was advised that this could be a better place to solve.  Can anyone help?

I am trying to produce an excel form that has correct screen colour reproduction in excel & when used as a .xls file in the numbers spreadsheet application I have been trying this various ways but cannot seem to find a correct solution. For example, I can set correct RGB colour references for a fill colour say R 255, G 241, B193 in excel.  this looks fine. If I then open in numbers, these colours change to R 254, G,242  B,205  I am not sure why. I had thought of creating each colour as an image fill from numbers but excel does not support this option? Could anyone advise me the best way to go about this please?
July 9th, 2013 1:56pm

.xls files support 56 distinct colors, and match any RGB colors to the closest available used color in the palette. You can change the color palette for you and all your users, but not all users will be happy about having to change to your palette (so that is a bad idea).  With colors, close is good enough. Or - fill in your cells with the color(s) you want, select those cells, and run this macro to get the RGB values:

Sub RGBIntColor()
    Dim rngC As Range
    Dim strCol As String
         
    For Each rngC In Selection
        strCol = Right("000000" & Hex(rngC.Interior.Color), 6)
        rngC.Value = "R" & CInt("&H" & Right(strCol, 2)) & _
        " G" & CInt("&H" & Mid(strCol, 3, 2)) & _
        " B" & CInt("&H" & Left(strCol, 2))
    Next rngC
     
End Sub


Free Windows Admin Tool Kit Click here and download it now
July 9th, 2013 3:31pm

Hi,

Thats really helpful, thanks for the info.

I'm not really good with excel so I am not quite sure :-

a) what to do with the macro

b) what this will do

If you could elaborate for this newbie, would really appreciate it...

July 9th, 2013 4:02pm

Let's say that you want to have a green, yellow, and blue fill for your application. Open a new workbook and save it with a name that you will recognize. Select a cell, fill it with the green you like from the formatting dialog, and do the same for a second cell for yellow, and a third for blue.  Select those three cells, then run the macro.

To run the macro, copy it, then  Press Alt-F11 from Excel to open the VBEditor, press Ctrl-R to open the project explorer, select your workbook (find the name you just used) and choose Insert / Module. In the window to the right, paste the code. Then press F5, and then go back to Excel (alt-F11 from the VBE or click to choose the Excel workbook).

The macro will put the RGB values into the cells that you colored, so that you can use those values that match what Excel actually uses, so that the colors look the same between your workbook and your userform.


Free Windows Admin Tool Kit Click here and download it now
July 9th, 2013 4:20pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics