Unexpected Results/Error Using SELECT() with Chart Series (114520)
The information in this article applies to:
- Microsoft Excel for Windows 95
- Microsoft Excel for Windows 5.0c
This article was previously published under Q114520 SYMPTOMS
In Microsoft Excel versions 5.x and 7.0, when you use the SELECT() function
in a Microsoft Excel 4.0 macro sheet to select a series on a chart, you
may receive either an error message or unexpected results when you
run the macro.
CAUSE
When you use the SELECT() function to select a chart series, for
example SELECT("S1"), the series number is the order in which the
series data appears on the supporting worksheet, not necessarily the
series order that you have given the series data.
For example, if you create a chart with data series in columns A
through C on a worksheet, and you use the command SELECT("S1")
function in a macro to select the first series on the chart, the
series created from column A is selected, even if you have changed
the series order so that the series in column A is actually the third
series.
This behavior is different from earlier versions of Microsoft
Excel: in Microsoft Excel version 4.0 and earlier, when you use the
SELECT() command to select a series on a chart, the series order is
used.
WORKAROUND
If you are writing a macro that you need to run in Microsoft Excel
versions 4.0, 5.0, and 7.0, and the syntax that you need to use depends on
the version in which the macro is running. You can use the GET.WORKSPACE()
function to determine the version, and then use the appropriate syntax as
in the following example:
=IF(GET.WORKSPACE(2)<5, SELECT("S1"), SELECT("S4"))
Because the GET.WORKSPACE(2) command returns the version of Microsoft
Excel that you are running, you can use this to take the appropriate
action. In the above macro command, if the version of Microsoft Excel
is less than 5.0, the first series is selected, otherwise, the fourth
series is selected.
REFERENCES
For more information about SELECT, choose the Search button in
Microsoft Excel Macro Functions Help and type:
Modification Type: | Minor | Last Reviewed: | 8/15/2005 |
---|
Keywords: | KB114520 |
---|
|