Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Changing color background in a range from a drop down

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Changing color background in a range from a drop down


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 140
Default Changing color background in a range from a drop down

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Changing color background in a range from a drop down

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Changing color background in a range from a drop down


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
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
Changing the background color of a cell Steve Excel Programming 4 November 9th 09 05:46 PM
changing background color Numa Excel Discussion (Misc queries) 0 June 10th 08 04:36 PM
changing background color greg Excel Programming 3 March 28th 08 08:32 PM
changing cell background color okelbes Excel Worksheet Functions 1 September 20th 06 03:28 PM
Changing background color when changing value [email protected] Excel Programming 9 July 6th 06 01:02 PM


All times are GMT +1. The time now is 10:13 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"