formula and Conditional Format

sprucethebruce

Board Regular
Joined
Jul 22, 2010
Messages
78
Could I get a cell with a name in it to go a certain colour when another cell has 'TRUE', written in it?

I'm sure this is simple but I can't for the life of me figure it out.
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Hi Give This a Go


Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Range("E4").Text = "TRUE" Then

Range("B4").Interior.Color = 65535
    
Else

 Range("B4").Interior.ThemeColor = xlThemeColorDark1    
 
 

End If
 
End Sub


Each time a selection changes, if the true condition is met in Cell E4 then the Interior colour of cell B4 is yellow.

Cheers


Kev
 
Upvote 0
Using Conditional Formatting instead of VBA, select the cell to be coloured, and just use a Formula Is condition, of:
Code:
=$A$99
... or whatever the cell reference is that you want to test. And choose the colour fill that you want when that cell is TRUE.
 
Upvote 0
Using Conditional Formatting instead of VBA, select the cell to be coloured, and just use a Formula Is condition, of:
Code:
=$A$99
... or whatever the cell reference is that you want to test. And choose the colour fill that you want when that cell is TRUE.

Excellent, thank you.
 
Upvote 0
Using Conditional Formatting instead of VBA, select the cell to be coloured, and just use a Formula Is condition, of:
Code:
=$A$99
... or whatever the cell reference is that you want to test. And choose the colour fill that you want when that cell is TRUE.

What if the cell I want highlighted could have a mixed content ... like ("Apr", "Apr/May", or even "15-Apr") ... in this case I'd want anything with the word "Apr" to highlight :eeek:

Thank you for any / all help!!
 
Upvote 0
What if the cell I want highlighted could have a mixed content ... like ("Apr", "Apr/May", or even "15-Apr") ... in this case I'd want anything with the word "Apr" to highlight :eeek:

Thank you for any / all help!!

How about something like:
Code:
=NOT(ISERROR(FIND("APR",UPPER(C1&TEXT(C1,"d/mmm/yy")))))
changing the C1's to whatever cell reference you need.
 
Upvote 0
What if the cell I want highlighted could have a mixed content ... like ("Apr", "Apr/May", or even "15-Apr") ... in this case I'd want anything with the word "Apr" to highlight :eeek:

Thank you for any / all help!!

How about something like:
Code:
=NOT(ISERROR(FIND("APR",UPPER(C1&TEXT(C1,"d/mmm/yy")))))
changing the C1's to whatever cell reference you need.
 
Upvote 0
Thanks Glen,

How would I rephrase this formula so that the "Apr" portion converts to whatever is placed into my reference cell...(a drop down field I'm building)

Ex: I type in "Sep/Oct" into the search field (my reference cell) ... my goal is to highlight all instances within my selected range (in this example "Sep") ...;)
 
Upvote 0
Thanks Glen,

How would I rephrase this formula so that the "Apr" portion converts to whatever is placed into my reference cell...(a drop down field I'm building)

Ex: I type in "Sep/Oct" into the search field (my reference cell) ... my goal is to highlight all instances within my selected range (in this example "Sep") ...;)
You'll have to explain that ... if you are typing "Sep/Oct" how does that match "Sep"? It doesn't, in my mind ... even if I know what you are aiming for, it still is not a match. How many cases like this would you be using? Maybe Jan/Feb/Mar or Aug-Dec even? If you are trying to highlight 2 months then use 2 conditional formats, one for each month, is one way of doing it.
 
Upvote 0
Thanks Glenn,

Sorry for the confusion... I suppose I may be asking the wrong question or using the wrong feature to do what I want to do with my calendar.

I used a data validation list to compile options for a drop down (in this case, months Jan-Dec) ... I then pushed out my calendar to our team for updating.. what I got back was folks typing in answers like 15-Apr, Apr/May or simply Apr.

I thought I could create a conditional format that would highlight the month in my drop down choice (like Apr) but I noted that only "Apr" would highlight. Perhaps I'm making this too hard? I'm green with Excel functions thus my struggle.

I suppose I could limit the choices for entry?

Does this help? :eeek:
Do you have another idea?
 
Upvote 0

Forum statistics

Threads
1,224,574
Messages
6,179,634
Members
452,934
Latest member
Jdsonne31

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