ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Updating Charts by a VBA code (https://www.excelbanter.com/excel-programming/394450-updating-charts-vba-code.html)

Abhijat

Updating Charts by a VBA code
 
Hi Group,
Here is my query.
I have created a column chart in an excel and now I want to update it
using a VBA code. I am able to do it but the trouble is, the format,
legends, etc. get changed.
The desired result should be something like this.
Once I select the criterion from the drop-down, only the corresponding
data in the chart should change. Nothing in terms of formatting or
legends or X/Y axis should change.

Kindly suggest a way out.

Regards,
Abhijat


Randy Harmelink

Updating Charts by a VBA code
 
An easy solution, non-VBA, is to use named ranges for your charts. If
the named ranges are based on spreadsheet contents, either cells or
controls, you can just change those contents and the chart
automatically updates as the area referenced by the named range
changes.

For an example, take a look at FunChrt7.zip from http://www.bmsltd.co.uk/Excel/Default.htm

On Jul 31, 1:09 am, Abhijat wrote:
Hi Group,
Here is my query.
I have created a column chart in an excel and now I want to update it
using a VBA code. I am able to do it but the trouble is, the format,
legends, etc. get changed.
The desired result should be something like this.
Once I select the criterion from the drop-down, only the corresponding
data in the chart should change. Nothing in terms of formatting or
legends or X/Y axis should change.

Kindly suggest a way out.

Regards,
Abhijat




Jon Peltier

Updating Charts by a VBA code
 
If you posted the code that didn't work the way you expected, someone might
be able to suggest some simple changes.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"Abhijat" wrote in message
ups.com...
Hi Group,
Here is my query.
I have created a column chart in an excel and now I want to update it
using a VBA code. I am able to do it but the trouble is, the format,
legends, etc. get changed.
The desired result should be something like this.
Once I select the criterion from the drop-down, only the corresponding
data in the chart should change. Nothing in terms of formatting or
legends or X/Y axis should change.

Kindly suggest a way out.

Regards,
Abhijat





All times are GMT +1. The time now is 07:19 PM.

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