Click on Chart to Select a New Source Range

Keywords: Chart, InputBox, Hidden Rectangle

Description: In this example, you can click on a chart and enter a new source range. The chart will redraw to show the data in the range you select.

Tip: You can create a Visual Basic for Applications procedure to prompt for a chart's input range. When you click on the chart, the prompt allows you to enter or select a new input range with the mouse. For a chart sheet, you can use a hidden rectangle to initiate the procedure. For an embedded chart, you can assign the procedure directly to the chart object.

Guide to the Example: A hidden rectangle is drawn over the chart on the chart sheet "Chart1" . When you click inside the rectangle, a Visual Basic for Applications procedure prompt for the source range.

Another procedure is assigned to the embedded chart on "Sheet1". Module 1 contains the code for both procedures.

Download File: Click Here
Tip: Click on the link above and choose "Save" to download the xls workbook to your hard drive or "Open" to open the workbook inside of your browser.

 

 

Last modified: May 21, 1996