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
srijanasapkota@gmail.com 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
Bookmarks