Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How can you make a range of cells in a row, change the background color based
on the option picked from a drop down. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Make the dropdown from Data Validation list. Set the Conditional Format of all the cells you want to change colour look at that Data Validation cell using a formula in CF. -- p45cal *p45cal* ------------------------------------------------------------------------ p45cal's Profile: http://www.thecodecage.com/forumz/member.php?userid=558 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=155269 Microsoft Office Help |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Kwitt
Use a combobox from the Control Toolbar, add a list fill range to the combobox and paste this code in the sheet where the combobox exits. Finally change the variables in this example to suit your needs. Take care Marcus Option Explicit Private Sub ComboBox1_Change() Dim x As String x = ComboBox1.Value ' Place a value in x. ' Start the Select Case structure. Select Case x Case "One" Range("A1").Interior.Color = vbGreen Case "Two" Range("A1").Interior.Color = vbRed Case "Three" Range("A1").Interior.Color = vbBlue Case Else 'Every other possibility. Range("A1").Interior.Color = vbYellow End Select End Sub |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Marcus,
Thank you!! Ok I got it to change color. In addition to the color change I need each combobox to be associated with only 1 row and the color changes would be for only that row. How do you do that?? I have tried but continue to get error statements. For example cell $H$5 will contain the drop down and Green has been choosen, so row 5 from column A - Y will than change to the green color. And then cell $H$6 will have its own drop down and they have choosen Yellow, so then row 6 from column A-Y will then be changed to Yellow. "marcus" wrote: Hi Kwitt Use a combobox from the Control Toolbar, add a list fill range to the combobox and paste this code in the sheet where the combobox exits. Finally change the variables in this example to suit your needs. Take care Marcus Option Explicit Private Sub ComboBox1_Change() Dim x As String x = ComboBox1.Value ' Place a value in x. ' Start the Select Case structure. Select Case x Case "One" Range("A1").Interior.Color = vbGreen Case "Two" Range("A1").Interior.Color = vbRed Case "Three" Range("A1").Interior.Color = vbBlue Case Else 'Every other possibility. Range("A1").Interior.Color = vbYellow End Select End Sub . |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Which version of Excel? If 2003 or earlier, how many choices in the dropdown? -- p45cal *p45cal* ------------------------------------------------------------------------ p45cal's Profile: http://www.thecodecage.com/forumz/member.php?userid=558 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=155269 Microsoft Office Help |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Changing the background color of a cell | Excel Programming | |||
changing background color | Excel Discussion (Misc queries) | |||
changing background color | Excel Programming | |||
changing cell background color | Excel Worksheet Functions | |||
Changing background color when changing value | Excel Programming |