Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
how to update certain text in a cell according to thecell colour
Hi
How can we write a macro which helps me to update certain text based on the cell colour. Eg. If cell B2 is formatted in "Red" colour then the text should be updated as "NO" and if it is formatted as green in colour then the text must be updated as "YES"? Can the same be done for a range of cells? Also is there a way by which i can trigger a macro on filling of a cell. Means the moment i enter some text in a specific cell (say B2) a macro should get triggred. |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
how to update certain text in a cell according to the cell colour
I think you've got it backwards, typically you want a "Yes" or "No" response,
and based on this, apply color to a cell. This is called Conditional Formatting. Look at this site: http://www.contextures.com/xlCondFormat01.html This was from a post a while back: I have a cell f2 that has a formula, and I want Macro1 to run automatically when that value is different than 0, or Macro2 to run if that value is = 0. Private Sub Worksheet_Change(ByVal Target As Range) if not intersect(target, range("H12:H1000")) is nothing if range("F2").value = 0 then Call Macro2 else Call Macro1 endif end if end sub Jim Thomlinson is quite a guy!! Regards, Ryan--- -- RyGuy "Ashish Patil" wrote: Hi How can we write a macro which helps me to update certain text based on the cell colour. Eg. If cell B2 is formatted in "Red" colour then the text should be updated as "NO" and if it is formatted as green in colour then the text must be updated as "YES"? Can the same be done for a range of cells? Also is there a way by which i can trigger a macro on filling of a cell. Means the moment i enter some text in a specific cell (say B2) a macro should get triggred. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Text to dictate colour of the cell and/or row | Excel Worksheet Functions | |||
how to colour a cell green if another cell is filled with text | Excel Discussion (Misc queries) | |||
Text Colour In Linked Cell | Excel Discussion (Misc queries) | |||
I cannot add fill colour to any cell, or use coloured text | Excel Worksheet Functions | |||
Update Macro: Leave Colour As Before Once Cell is Not Active | Excel Discussion (Misc queries) |