ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel 2002 (https://www.excelbanter.com/excel-programming/332616-excel-2002-a.html)

אמיר

Excel 2002
 
Hello all,

If I have in A1 red background color.
What should i write down in B1 inroder to return the color value of A1?
Is it a function or vba code?

Thanks
Amir

Toppers

Excel 2002
 
Hi,

Range("b1").Interior.ColorIndex = Range("a1").Interior.ColorIndex ' Set colour

Range("b1= Range("a1").Interior.ColorIndex ' Value of colour index

"אמיר" wrote:

Hello all,

If I have in A1 red background color.
What should i write down in B1 inroder to return the color value of A1?
Is it a function or vba code?

Thanks
Amir


Bob Phillips[_7_]

Excel 2002
 
Function ColorIndex(rng As Range)
If rng.Cells.Count = 1 Then
ColorIndex = rng.Interior.ColorIndex
End If
End Function


use like

=ColorIndex(A1)

--
HTH

Bob Phillips

"????" wrote in message
...
Hello all,

If I have in A1 red background color.
What should i write down in B1 inroder to return the color value of A1?
Is it a function or vba code?

Thanks
Amir





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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com