ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Charts and Charting in Excel (https://www.excelbanter.com/charts-charting-excel/)
-   -   drawing chart only of select data (https://www.excelbanter.com/charts-charting-excel/83613-drawing-chart-only-select-data.html)

[email protected]

drawing chart only of select data
 
Hi All,
I am very new person to VBA world. I am given a task of drawing a
XY Scatter Plot of data that are marked 1 ( or marked by checkbox) and
showing the labels of those data. I started with some online help and
auto-filter but I am stuck now.

This is the kind of data I have:

State Height Age Show Flag
A 100 2 0
B 200 10 1
M 300 1 0
D 400 8 1
E 250 9 0

I used the code from
http://support.microsoft.com/?kbid=213750
to add data lables to my plot but when I use auto-filter to show the
rows with the "show flag=1", then the code snippet from Microsoft
doesn't take the filtering into account and shows the labels from the
unfiltered data.

I am plotting height(x axis) versus Age(y-axis) with State name as data
label.

Any help would be appreciated.

thank you
Sri


Andy Pope

drawing chart only of select data
 
Hi,

You should only need to run the code once to apply labels to all points.
The use auto filter to reduce the points displayed. This will only work
if you have the option "Plot visible cells only" enabled. Select the
chart and use the menus Tools Options Chart to check setting.

Cheers
Andy

wrote:
Hi All,
I am very new person to VBA world. I am given a task of drawing a
XY Scatter Plot of data that are marked 1 ( or marked by checkbox) and
showing the labels of those data. I started with some online help and
auto-filter but I am stuck now.

This is the kind of data I have:

State Height Age Show Flag
A 100 2 0
B 200 10 1
M 300 1 0
D 400 8 1
E 250 9 0

I used the code from
http://support.microsoft.com/?kbid=213750
to add data lables to my plot but when I use auto-filter to show the
rows with the "show flag=1", then the code snippet from Microsoft
doesn't take the filtering into account and shows the labels from the
unfiltered data.

I am plotting height(x axis) versus Age(y-axis) with State name as data
label.

Any help would be appreciated.

thank you
Sri


--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info


All times are GMT +1. The time now is 03:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com