Conditional Formatting - Show List and Colors
Select a colour name from a drop down list, and the next cell fills with the selected colour. There are no macros, just data validation drop downs and conditional formatting rules.
Introduction
Set Up the Workbook
Name the Lists
Create the Options Drop Down
Create Color Drop Downs
Create List of Option Numbers
Format the Color Drop Downs
Format the Sample Cells
Get the Sample File
More Tutorials
Introduction
On a data entry sheet, select a number of options from a drop down list. That number of options show up in the data entry area. Then, select a color for each item, from another drop down list. In the cell to the right, the selected color is shown.
Watch this video to see the steps for creating this worksheet, with conditional formatting and data validation. The written instructions are below the video.
Set Up the Workbook
In the workbook, there is an Options sheet, with headings, and this sheet is where the drop downs and formatting will be added.
On the Lists sheet, there are 2 lists -- a list of 8 numbers and a list of three colors.
Name the Lists
To use these lists in data validation drop down lists, create a named range for each list.
To name the numbers list:
- On the Lists sheet, select all the numbers
- Click in the Name box, and type a one-word name -- NumList
- Press Enter, to complete the name
To name the colors list:
- On the Lists sheet, select all the colors
- Click in the Name box, and type a one-word name -- ColorList
- Press Enter, to complete the name.
Create the Options Drop Down
On the Options sheet, create a drop down list of numbers, so people can select a specifi number of Options..
- Select cell C2, where the list will appear.
- On the Ribbon's Data tab, click Data Validation
- For Allow, select List
- Click in the Source box, and press the F3 key, to open the Paste Name window
- Select NumList, and click OK, twice.
A drop down list of numbers now appears in the Number of Options cell.
Format the cell
Next, format the cell, to make it clear that the cell is for data entry.
- Select cell C2
- Format the cell with a light blue fill color
- Add an Outside border to the cell.
- Center the text in the cell.
Create Color Drop Downs
Next, set up the 8 cells with drop down lists of colors.
- Select cells C5:C12
- On the Ribbon's Data tab, click Data Validation
- For Allow, select List
- Click in the Source box, and press the F3 key, to open the Paste Name window
- Select ColorList, and click OK, twice.
A drop down list of colors now appears in each of the Color cells.
Create List of Option Numbers
Next, create a list of numbers on the Options sheet
- In cells B5:B12, type the numbers 1 through 8
Next, the option numbers will be formatted:
- When the sheet is first opened if nothing is selected for the number of options, no Option numbers should appear.
- When someone selects a number of options, those numbers should appear in black font, with an outline border.
To hide the numbers if nothing is selected for the number of options:
- Select cells B5:B12
- Change the font color to white
- Change the fill color to white
To show the applicable numbers, when a selection in made in cell C2 [number of options]:
- Select cells B5:B12
- On the Ribbon's Home tab, click Conditional Formatting, New Rule
- Click Use a Formula to Determine Which Cells to Format
- In the formula box, type the following formula, which refers to the active cell -- B5:
=B5