Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,836
Default 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
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
Text to dictate colour of the cell and/or row Aaron Hodson \(Coversure\) Excel Worksheet Functions 2 October 5th 07 10:38 AM
how to colour a cell green if another cell is filled with text terence Excel Discussion (Misc queries) 3 March 11th 07 04:38 PM
Text Colour In Linked Cell [email protected] Excel Discussion (Misc queries) 1 April 5th 06 06:59 AM
I cannot add fill colour to any cell, or use coloured text julianm Excel Worksheet Functions 2 March 2nd 06 07:58 PM
Update Macro: Leave Colour As Before Once Cell is Not Active JB2010 Excel Discussion (Misc queries) 2 February 2nd 06 06:08 PM


All times are GMT +1. The time now is 09:20 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"