ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro creates two graphs instead of one? (https://www.excelbanter.com/excel-programming/375525-macro-creates-two-graphs-instead-one.html)

et10yl

Macro creates two graphs instead of one?
 
Hi,
I used the macro recorder to record all the steps that I took to create a
graph. However, when I try to run the macro, it creates two versions of the
graph that I want - putting them in as Chart1 and Chart 2 (or whatever else
the numbers happen to be) in my workbook.

Chart1 is usually the chart that I want, which has a title and data table,
and Chart2 is the same chart but without the title and data table. I only
want Chart1. Any thoughts on why Excel is doing this?

FYI, I am creating a bar graph, and the macro is supposed to define chart
title and put in the data table under the graph.

Thanks!

Tom Ogilvy

Macro creates two graphs instead of one?
 
I suspect you have included code that creates the additional (could have been
a mistake when you were recording). Perhaps it creates the one with missing
elements, then copies it and adds the elements. If so, you would need to
remove the lines that do this.

--
Regards,
Tom Ogilvy




"et10yl" wrote:

Hi,
I used the macro recorder to record all the steps that I took to create a
graph. However, when I try to run the macro, it creates two versions of the
graph that I want - putting them in as Chart1 and Chart 2 (or whatever else
the numbers happen to be) in my workbook.

Chart1 is usually the chart that I want, which has a title and data table,
and Chart2 is the same chart but without the title and data table. I only
want Chart1. Any thoughts on why Excel is doing this?

FYI, I am creating a bar graph, and the macro is supposed to define chart
title and put in the data table under the graph.

Thanks!



All times are GMT +1. The time now is 08:27 AM.

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