18.11.2014 Views

Microsoft Office

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Part III<br />

Creating Charts and Graphics<br />

FIGURE 21.4<br />

The length of the data bars is proportional to the value in the cell.<br />

TIP<br />

The differences among the bar lengths become more prominent when you increase the column<br />

width.<br />

Excel provides quick access to six data bar colors via the Home ➪ Styles ➪ Conditional Formatting ➪ Data<br />

Bars command. For additional choices, click the More Rules option, which displays the New Formatting<br />

Rule dialog box. Use this dialog box to:<br />

n<br />

n<br />

n<br />

Show the bar only (hide the numbers)<br />

Adjust how the bars relate to the values (use the Type and Value controls)<br />

Change the color of the bars<br />

Data bars are always displayed as a color gradient (from dark to light), and you can’t change<br />

the display style. Also, the colors used are not theme colors. If you apply a new document<br />

theme, the data bar colors do not change.<br />

NOTE<br />

If you make adjustments in this dialog box, you can use the Preview button to see the formats before you<br />

commit to them with the OK button.<br />

You may notice something odd about the data bars in Figure 21.4. Contrary to what you may<br />

expect, a cell with a zero value displays a data bar. Data bar conditional formatting always displays<br />

a bar for every cell, even for zero values. The smallest value in the range always has a bar length equal<br />

to 10 percent of the cell’s width. Unfortunately, Excel provides no direct way to modify the minimum percent<br />

setting. But, if you’re familiar with VBA, you can use a statement like the following to set the minimum<br />

display width for a range that uses conditional formatting data bars:<br />

NOTE<br />

Range(“B2:B123”).FormatConditions(1).PercentMin = 1<br />

After this statement is executed, the minimum value in the range will display a bar length equal to 1 percent<br />

of the cell’s width — and zero value cells will not display a data bar.<br />

426

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!