Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default How do I invoke a call in Excel

I am trying to build a spreadsheet containing cells with 4 different
background colors. Red, yellow, green, and white. I want to graph the
results of the spreadsheet based on background color for each cell. I
extracted the following formula via another discussion but do not know how to
use it (call it or invoke it).

Function BackColour(r As Range)
Select Case r.Interior.ColorIndex
Case Is = 6 'Yellow
BackColour = 1
Case Is = 4 'Green
BackColour = 2
Case Is = 3 'red
BackColour = 3
Case Else
BackColour = "Not Defined"
End Select
End Function

Can someone tell me how to apply this and use the calculated results in a
graph? Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,805
Default How do I invoke a call in Excel

Use it just as you use any Excel formula...

First part use this in the cell you want to find the Back Color
(assuming the function is in the same workbook otherwise precede it with the
name of the workbook)

=BackColor(A1)

Once you get the colors then you can make a graph in the normal way.

"DeviceConnect" wrote:

I am trying to build a spreadsheet containing cells with 4 different
background colors. Red, yellow, green, and white. I want to graph the
results of the spreadsheet based on background color for each cell. I
extracted the following formula via another discussion but do not know how to
use it (call it or invoke it).

Function BackColour(r As Range)
Select Case r.Interior.ColorIndex
Case Is = 6 'Yellow
BackColour = 1
Case Is = 4 'Green
BackColour = 2
Case Is = 3 'red
BackColour = 3
Case Else
BackColour = "Not Defined"
End Select
End Function

Can someone tell me how to apply this and use the calculated results in a
graph? Thanks.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Thank you

I also forgot to mention that I have text in each cell that I want to retain.
How do keep that in tact while assigning the function to the cell?
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,805
Default Thank you

You can't have your cake and eat it too :-)

If the text in A1 is TEST and color is YELLOW then do you want B1 to say
TEST-YELLOW?

If yes then use
=A1 & "-" & BackColor(A1)

If not then give an example so that we can understand your requirement.

"DeviceConnect" wrote:

I also forgot to mention that I have text in each cell that I want to retain.
How do keep that in tact while assigning the function to the cell?

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Thank you

Cake? I love cake...but it appears I can not have it if my suspicions are
correct. What I have is a series of cells with the date in them. Each cell
background color (yellow, red, or green) corresponds to product delivery
dates. If the date has come and gone and the project not completed the
background color is red, if the delivery date is in the near future and the
project still in progress the color is yellow, and if the project was
delivered on time and the date has come and gone the background color is
green. What I want to do is group the not done, in progress, completed
deliverables by color, not by date. That way I can report the 3 categories
of completion each as one group of data. I still need both pieces of
information for visual verification.

"Sheeloo" wrote:

You can't have your cake and eat it too :-)

If the text in A1 is TEST and color is YELLOW then do you want B1 to say
TEST-YELLOW?

If yes then use
=A1 & "-" & BackColor(A1)

If not then give an example so that we can understand your requirement.

"DeviceConnect" wrote:

I also forgot to mention that I have text in each cell that I want to retain.
How do keep that in tact while assigning the function to the cell?



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,805
Default Thank you

:-)


"DeviceConnect" wrote:

Cake? I love cake...but it appears I can not have it if my suspicions are
correct. What I have is a series of cells with the date in them. Each cell
background color (yellow, red, or green) corresponds to product delivery
dates. If the date has come and gone and the project not completed the
background color is red, if the delivery date is in the near future and the
project still in progress the color is yellow, and if the project was
delivered on time and the date has come and gone the background color is
green. What I want to do is group the not done, in progress, completed
deliverables by color, not by date. That way I can report the 3 categories
of completion each as one group of data. I still need both pieces of
information for visual verification.

"Sheeloo" wrote:

You can't have your cake and eat it too :-)

If the text in A1 is TEST and color is YELLOW then do you want B1 to say
TEST-YELLOW?

If yes then use
=A1 & "-" & BackColor(A1)

If not then give an example so that we can understand your requirement.

"DeviceConnect" wrote:

I also forgot to mention that I have text in each cell that I want to retain.
How do keep that in tact while assigning the function to the cell?

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
how do I invoke formula pattern copying? Bob Excel Worksheet Functions 4 December 6th 08 11:27 PM
text in a cell invoke constant date in another cell - how Frode Inge Helland Excel Discussion (Misc queries) 1 September 18th 08 09:25 PM
HELP: Setting CNTL-SHIFT-F to invoke Excel2007 macro Jay Somerset Excel Discussion (Misc queries) 7 June 3rd 07 09:40 PM
Call Center Management: How to calculate 'cost per call' Denniso6 Excel Discussion (Misc queries) 2 June 25th 06 05:01 PM
add data to combo box in excel then invoke macro Richard Excel Worksheet Functions 1 December 11th 05 08:50 PM


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

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"