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 Fill cell colour based on input in another cell

I have a sheet with a number of links to another worksheet. What i now want
to add is automatic colour change in cells dependant on input from another
formula eg:-

If cell B3 formula answer says E i want all cells below in the same column
to turn a different for example blue. There will be four possible options :-
E L M or O, and the fields needing filling will be from B6 - B31 to P6 - P31

Is there a macro as i have used contitional formating for another field?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,520
Default Fill cell colour based on input in another cell

Set the Security level to low/medium in (Tools|Macro|Security). From workbook
launch VBE using short-key Alt+F11. From the left treeview search for VBA
Project for the current workbook. Click on + to expand it . You will find
'This Workbook' within the VBA project tree...Double click and paste the
below code and try ..Dont forget to edit the sheetname..in which you need to
fill color.


Private Sub Workbook_SheetCalculate(ByVal Sh As Object)
Application.EnableEvents = False
With Sheets("Sheet3")
..Range("B6:P31").Interior.ColorIndex = -4142
Select Case .Range("B3")
Case "E"
..Range("B6:P31").Interior.ColorIndex = 5
Case "L"
..Range("B6:P31").Interior.ColorIndex = 4
Case "M"
..Range("B6:P31").Interior.ColorIndex = 3
Case "O"
..Range("B6:P31").Interior.ColorIndex = 6
End Select
End With
Application.EnableEvents = True
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Dan Wood" wrote:

I have a sheet with a number of links to another worksheet. What i now want
to add is automatic colour change in cells dependant on input from another
formula eg:-

If cell B3 formula answer says E i want all cells below in the same column
to turn a different for example blue. There will be four possible options :-
E L M or O, and the fields needing filling will be from B6 - B31 to P6 - P31

Is there a macro as i have used contitional formating for another field?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 6
Default Fill cell colour based on input in another cell

My first reflex would be to look into conditional formatting. What version of
Excel are you using?

Not everybody is familiar with the fact that many cells can be formatted
based on the input of the result of a formula. This result can even be
outside the range that will be formatted.

I am not sure to understand what you mean by "the fields needing filling
will be from B6 - B31 to P6 - P31".

If the value is E then B6:B31 becomes, say, blue. What happens between B and
P? Are other letters in other columns as well and is the colour is different?
Tell me if you are using XL 2007?

Cheers,

--
Daniel


"Dan Wood" wrote:

I have a sheet with a number of links to another worksheet. What i now want
to add is automatic colour change in cells dependant on input from another
formula eg:-

If cell B3 formula answer says E i want all cells below in the same column
to turn a different for example blue. There will be four possible options :-
E L M or O, and the fields needing filling will be from B6 - B31 to P6 - P31

Is there a macro as i have used contitional formating for another field?

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
How to input pictures automatically based on cell input? bsharp Excel Worksheet Functions 9 May 30th 09 07:16 AM
fill cell with colour if preceding cell is a negative value POP Excel Discussion (Misc queries) 4 April 27th 09 05:35 PM
conditional colour fill a row - based on cell value =100% Greg[_4_] Excel Worksheet Functions 2 April 29th 08 02:57 PM
How to make a cell copy the fill colour of another cell Chase Excel Worksheet Functions 1 February 21st 08 10:29 AM
Fill colour a cell from the linked cell Stephen C Excel Discussion (Misc queries) 1 September 28th 05 03:56 PM


All times are GMT +1. The time now is 03:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"