Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
y_not
 
Posts: n/a
Default Conditional formatting help required please


I have a spreadsheet where cell C& requires the user to enter either "Y"
or "N". Depending which they enter I need to recolour cells B7:B12.

I have completely run out of ideas for how to do this - Excel bible,
web searches etc. have not solved the problem.

Can someone please please put me out of my misery - I know it can be
done and I'm sure its simple (when you know how)?

Many thanks

Tony (now you know why I log in backwards ... ynoT !!!)


--
y_not
------------------------------------------------------------------------
y_not's Profile: http://www.excelforum.com/member.php...o&userid=19947
View this thread: http://www.excelforum.com/showthread...hreadid=389006

  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

If there are 3 or loess values, you can use conditional formatting -
FormatConditional Formatting... Select the cell, invoke CF, and enter your
first value, click Format and set the colour. For more conditions, click the
Add.

If you have more than 3 conditions, use worksheet events

Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
With Target
If .Address = "$C$10" Then
Select Case .Value
Case 1: .Interior.ColorIndex = 3
Case 2: .Interior.ColorIndex = 5
Case 3: .Interior.ColorIndex = 6
Case 4: .Interior.ColorIndex = 10
'etc
End Select
End If
End With

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.



--

HTH

RP
(remove nothere from the email address if mailing direct)


"y_not" wrote in
message ...

I have a spreadsheet where cell C& requires the user to enter either "Y"
or "N". Depending which they enter I need to recolour cells B7:B12.

I have completely run out of ideas for how to do this - Excel bible,
web searches etc. have not solved the problem.

Can someone please please put me out of my misery - I know it can be
done and I'm sure its simple (when you know how)?

Many thanks

Tony (now you know why I log in backwards ... ynoT !!!)


--
y_not
------------------------------------------------------------------------
y_not's Profile:

http://www.excelforum.com/member.php...o&userid=19947
View this thread: http://www.excelforum.com/showthread...hreadid=389006



  #3   Report Post  
tonywig
 
Posts: n/a
Default


for cells B7 to B12, set the conditional format to something like ...

Condition 1.
Formula.
=if(C7="Y",1,0)
Then set the colours accordingly.

Condition 2.
Formula.
=if(C7="N",1,0)
Then set the colours accordingly.

Hope I've understood correctly and this helps.


--
tonywig


------------------------------------------------------------------------
tonywig's Profile: http://www.excelforum.com/member.php...o&userid=18985
View this thread: http://www.excelforum.com/showthread...hreadid=389006

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
Conditional Formatting Error ddate Excel Worksheet Functions 0 May 5th 05 09:00 PM
difficulty with conditional formatting Deb Excel Discussion (Misc queries) 0 March 23rd 05 06:13 PM
conditional formatting question Deb Excel Discussion (Misc queries) 0 March 23rd 05 02:07 AM
Determine cells that drive conditional formatting? Nicolle K. Excel Discussion (Misc queries) 2 January 7th 05 01:08 AM
Conditional formatting not available in Excel BAB Excel Discussion (Misc queries) 2 January 1st 05 03:33 PM


All times are GMT +1. The time now is 08:18 AM.

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"