ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Conditional formatting and Dropdowns (https://www.excelbanter.com/excel-programming/427579-conditional-formatting-dropdowns.html)

Lenny

Conditional formatting and Dropdowns
 
Without creating a circular reference, is it possible to place a dropdown in
a cell whereby when the user makes a selection (alpha and not numeric) the
cell the dropdown is in will change color based on the selection from the
dropdown?

I noticed that the Conditional Formatting dropdown only allows for 3 options
(if, then, else?) I recently set up a form using numeric entries that worked
fine but have a requirement to set up a scenario whereby the cell starts off
blank... user selects A from dropdown and cell turns red/white type... or B
and cell turns green/white type... or C and cell turns white/black type.
This is replicated 36 times on a rating form (protected sheet/workbook) in
Excel 2003.

Can this be accomplished? Is any of the process dependent on whether the
cell/worksheet/workbook is protected? My thanks for any assistance with this
problem.... regards

Jay

Conditional formatting and Dropdowns
 
Try use VBA to control it. You can use

if cells(r,c)="A" then
cells(r,c).Interior.ColorIndex = red
cells(r,c).font.ColorIndex = white
elseif if cells(r,c)="B" then
cells(r,c).Interior.ColorIndex = green
cells(r,c).font.ColorIndex = white
elseif cells(r,c)="C" then
cells(r,c).Interior.ColorIndex = white
cells(r,c).font.ColorIndex = black
else
...
end if

You can run as many if ... then as you want. -Jay

"Lenny" wrote:

Without creating a circular reference, is it possible to place a dropdown in
a cell whereby when the user makes a selection (alpha and not numeric) the
cell the dropdown is in will change color based on the selection from the
dropdown?

I noticed that the Conditional Formatting dropdown only allows for 3 options
(if, then, else?) I recently set up a form using numeric entries that worked
fine but have a requirement to set up a scenario whereby the cell starts off
blank... user selects A from dropdown and cell turns red/white type... or B
and cell turns green/white type... or C and cell turns white/black type.
This is replicated 36 times on a rating form (protected sheet/workbook) in
Excel 2003.

Can this be accomplished? Is any of the process dependent on whether the
cell/worksheet/workbook is protected? My thanks for any assistance with this
problem.... regards



All times are GMT +1. The time now is 04:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com