Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I have created drop down boxes in Excel using the validation tool but I need
each option to have a different fill colour. How do I do this? |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
One way:
This code changes the background depending on the value in your DV cell: in the example it is cell C1 '----------------------------------------------------------------- Private Sub Worksheet_Change(ByVal Target As Range) '----------------------------------------------------------------- Const WS_RANGE As String = "C1:C1" '<=== change to your DV cell On Error GoTo ws_exit: Application.EnableEvents = False If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then With Target Select Case .Value '<== need to change test to reflect you DV values Case 1: .Interior.ColorIndex = 3 'red Case 2: .Interior.ColorIndex = 6 'yellow Case 3: .Interior.ColorIndex = 5 'blue Case 4: .Interior.ColorIndex = 10 'green 'etc. End Select End With End If ws_exit: Application.EnableEvents = True End Sub To use code: right-click on w/sheet tab, "View code" and copy/paste above code HTH "Liz" wrote: I have created drop down boxes in Excel using the validation tool but I need each option to have a different fill colour. How do I do this? |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
On Jun 14, 12:41 pm, Liz wrote:
I have created drop down boxes in Excel using the validation tool but I need each option to have a different fill colour. How do I do this? You can use conditional formatting so long as your list is not more than 3 In the conditional formatting dialogue box select formula is: and enter the following formula =A1 = "Option 1" then format Assuming your list starts at A1. Make sure you put the options in "quotations" |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Liz,
I'm pretty sure you can't do that. The only thing that comes to mind is to make your own userform, with which you need to write macros to handle everything. A button on the worksheet, similar to the dropdown button, would initiate your userform. It wouldn't appear directly below the cell without some coaxing, though. -- Earl Kiosterud www.smokeylake.com Note: Some folks prefer bottom-posting. But if you bottom-post to a reply that's already top-posted, the thread gets messy. When in Rome... ----------------------------------------------------------------------- "Liz" wrote in message ... I have created drop down boxes in Excel using the validation tool but I need each option to have a different fill colour. How do I do this? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
colour description boxes | Excel Discussion (Misc queries) | |||
can the fill colour of a bar be tied to the data font colour data | Charts and Charting in Excel | |||
Fill Colour | Excel Discussion (Misc queries) | |||
How to fill colour in Excel, it appers No fill in my computer? | Excel Discussion (Misc queries) | |||
Sum by Fill colour | Excel Worksheet Functions |