Hi,
I need to say:
If [F10] is red, then: blah blah
I'm looking to do this. Please can you instruct me on the green bit
=IF(F10 IS RED,(F10/-1)+F9,F10+F9)
Hi,
I need to say:
If [F10] is red, then: blah blah
I'm looking to do this. Please can you instruct me on the green bit
=IF(F10 IS RED,(F10/-1)+F9,F10+F9)
Last edited by VBA Noob; 10-25-2007 at 07:42 AM.
You'll need to use Visual Basic to do this. Either go Tools>Macro>Visual Basic Editor or hit Alt + F11. Then select your workbook in the left hand panel by clicking on "VBAProject (yourfilename.xls)". Next go Insert>Module and paste the following code into the new window:
Exit VBA and return to your workbook. Now change your formula to:Please Login or Register to view this content.
=IF(ColorIndex(F10)=3,(F10/-1)+F9,F10+F9))
The 3 above represents the colour index of red - to see a full list of excel colour indeces, click here:
http://www.mvps.org/dmcritchie/excel...htm#colorindex
Let me know if this helps.
Last edited by owainl; 10-25-2007 at 07:50 AM.
That doesn't seem to work. I'll explain more...
I have cells that are represented as positive values which are actually negative. The text cells in these cells is red (not the cells themselves)
I need to do something like this in G11
=(IF(ColorIndex(G10)=3,(G10/-1),G10))
in order to figure out which are negative and which aren't.
The last answer I recieved didn't work...
Please help
Hi,
Replace this
with this:Please Login or Register to view this content.
Please Login or Register to view this content.
Rule 1: Never merge cells
Rule 2: See rule 1
"Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".
Do i have to save in visual basic or apply the module in some way to make it take effect?
Hi beesus311,
Is the format category set to a Negative number (shows number as color red in a cell)? If that is that is the case you can use this formula:
orPlease Login or Register to view this content.
Please Login or Register to view this content.
Last edited by corinereyes; 10-29-2007 at 09:48 AM.
Corine
Unfortunately not. That is the problem. I need it to know that it is negative, but it just knows it's red.
Hi beesus311,
If the font color is red try to put this on a VBA module:
then try this formula on the excel sheet:Please Login or Register to view this content.
If the fill color of the cell is red put this also in a VBA module:Please Login or Register to view this content.
then try this formula:Please Login or Register to view this content.
Try the excel sheet attached.Please Login or Register to view this content.
Hi, Thank you for the code and formula. It really helps, however, it does not get the result if the cell color was due to conditional formatting. is there another code to change for this? Thanks!
Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread.
Where there is a will there are many ways.
If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner
Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
[QUOTE=beesus311;1842558]Hi,
I need to say:
If any cell is red, then: 0 without any VBA ...i dont know how can i set formula for this
can anyone tell me how can i put formula for colour
I'm looking to do this. Please can you instruct me on this...
cell color is red than I get returned value is 0
rake.png= 0
Last edited by rraushan2088; 12-14-2016 at 05:05 AM.
rraushan2088 welcome to the forum
Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.
If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.
Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
Also, color is cosmetic formatting, not data, and formulas work on data
1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
2. If your question is resolved, mark it SOLVED using the thread tools
3. Click on the star if you think someone helped you
Regards
Ford
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks