#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default 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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default 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



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
Excel 2002 : Unable to open files in MS Outlook 2002 Mr. Low Excel Discussion (Misc queries) 1 June 29th 07 02:12 PM
Outlook 2002 calendar dates exported to Excel 2002 sort incorrectl scampbell Excel Worksheet Functions 0 February 22nd 06 06:31 PM
Access 2002 VB Module controlling Excel 2002 spreadsheet -Run-time Mblackmore Excel Programming 0 May 12th 05 07:56 PM
Can you print labels using Excel 2002 in a Word 2002 mail merge? Individual_ Excel Discussion (Misc queries) 3 December 17th 04 08:39 PM
Excel 2002 files attached to Outlook 2002 EMails change size AJStadlin Excel Programming 1 October 15th 03 12:12 AM


All times are GMT +1. The time now is 05:31 PM.

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

About Us

"It's about Microsoft Excel"