Sub that takes the value of a function

AT--o

New Member
Joined
Aug 24, 2010
Messages
19
Hi.
In excel 2007.

My function takes its arguments from cells on the same row that it is inserted. I just copy it down. The problem is I need to change the Interior of this cell (the one containing the function) according to values that while taken from operations between the arguments are not the value of the function. (otherwise I would use excel conditional formatting). I know the interior of a cell can't be changed by a function so...

Whats the code for the Sub? Im specially confuse about passing the arguments.
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
{Cell}.Interior.Color = RGB(0~255,0~255,0~255)

Example:
If you want to color your cell's interior red.
Range("A1").Interior.Color = RGB (255,0,0)
 
Upvote 0
You can use conditional formatting to format one cell based on values in OTHER cells..

Selcect "Formula Is" instead of Value is
and enter a formula

So you could color cell B1 based on A1's Value.

Highlight B1, and click Conditional Formatting - New Rule.
Selct "Use a Formula to determine..." from the Rule Type
Enter
=A1="Hello"
Select your format and click OK

Now B1 will change format based on A1's value changing to "Hello"


Hope that helps.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,974
Messages
6,122,536
Members
449,088
Latest member
RandomExceller01

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top