Watch Video – Highlight Data Points in Excel with a Click of a Button A chart gets difficult to read if it has a lot of data plotted on it. While it is a good practice to plot only the relevant data, there are situations where you need to show a lot of data points on a single chart. If you are stuck in such a situation, it is a good idea to have a dynamic chart that highlights the selected series so that it is easier to read and compare. Something as shown below: In the above chart, when you click on the button, the selected year’s series gets highlighted with red marker outline and the data labels. Follow Along.. Download the Chart Highlight Data Points in Excel Line ChartHere is how you can create this type of charts:
If you have followed all the above steps, you would have something as shown below: Now to make the buttons functional, we will use a simple VBA code. The VBA codeWe will use VBA code to do 2 things:
Simply copy the following code in the VB Editor. Sub SelectYear2013() Range("F2").Value = 2013 ActiveSheet.Shapes("2013").Fill.ForeColor.RGB = RGB(176, 196, 222) ActiveSheet.Shapes("2014").Fill.ForeColor.RGB = RGB(255, 255, 255) ActiveSheet.Shapes("2015").Fill.ForeColor.RGB = RGB(255, 255, 255) End Sub Sub SelectYear2014() Range("F2").Value = 2014 ActiveSheet.Shapes("2013").Fill.ForeColor.RGB = RGB(255, 255, 255) ActiveSheet.Shapes("2014").Fill.ForeColor.RGB = RGB(176, 196, 222) ActiveSheet.Shapes("2015").Fill.ForeColor.RGB = RGB(255, 255, 255) End Sub Sub SelectYear2015() Range("F2").Value = 2015 ActiveSheet.Shapes("2013").Fill.ForeColor.RGB = RGB(255, 255, 255) ActiveSheet.Shapes("2014").Fill.ForeColor.RGB = RGB(255, 255, 255) ActiveSheet.Shapes("2015").Fill.ForeColor.RGB = RGB(176, 196, 222) End Sub To copy this code:
Assign Macros to ButtonsOnce you have the VBA code in place, you need to assign macros to the buttons/shapes. To do this:
Note: Since this workbook contains a macro, save it as a .xlsm or .xls format file. Now your dynamic chart is ready. With a single click, you can now highlight data points for the selected series. Download the file More on Dynamic Excel Charting Tutorials:
Which of these series of clicks will you select to add text to a smart art?Insert a SmartArt graphic and add text to it
On the Insert tab, in the Illustrations group, click SmartArt. In the menu of types that appears, point at the type you want and then select a layout. Enter your text by doing one of the following: Click [Text] in the Text pane, and then type your text.
How can you add a new picture to a SmartArt graphic?Insert pictures in SmartArt
Select More SmartArt Graphics and then select Picture. Select the SmartArt you want and select OK. To insert a picture, select the picture icon, go to where your picture is located, and then select it. Select Insert.
Which of the following can you apply to change the way a SmartArt graphic looks?You can change the look of your SmartArt graphic by changing the fill of its shape or text; by adding effects, such as shadows, reflections, glows, or soft edges; or by adding three-dimensional (3-D) effects, such as bevels or rotations.
Which of the following can you use to insert a picture in a SmartArt shape?How can you add a new picture to a SmartArt graphic? Select a picture, click the Insert tab under Picture Tools, click the Insert Picture, and then select a layout.
|