Question: This is Macro1() : First, make a copy of Macro10 and paste it in the same module and rename it Macro20. Then, make changes to

 This is Macro1() : First, make a copy of Macro10 and

This is Macro1() :

paste it in the same module and rename it Macro20. Then, make

First, make a copy of Macro10 and paste it in the same module and rename it Macro20. Then, make changes to Macro20 so that it creates a chart for any selected dataset. In other words, Macro10 creates a Clustered Bar chart from a dataset located at a specific data region. You cannot use it if you want to create a Clustered Bar chart from a dataset located at a different data region. Finally, improve Macro20 so that it asks the user for a chart title and a worksheet name. You will use the InputBox() function twice for this task. region, so no workarounds!) Hint. Testing your macro on both the data regions means you will (1) highlight the region that have the data that you want to put in your chart and then (2) run your macro to ask the user for a worksheet name that you will move your chart to, e.g., if you want the "Sales Figures for Four Cities from January to March" data, first you highlight cells A3:E6, then run your macro. Don't forget adding your comments and cleaning up the macro so it looks neater. Sub Macro1() 'Add a chart onto the active sheet and select the chart ActiveSheet.Shapes.AddChart.Select With ActiveChart 'Chart type is Clustered Bar chart .ChartType =xx BarClustered 'The data set is located in cells A3:E6 of "Sheet1" worksheet .SetSourceData Source:=Worksheets("Sheet1").Range("A3:E6") 'Set a chart title, located at the top of the chart .SetElement (msoElementChartTitleAboveChart) 'Assign the content of cell B1 to the title of the chart .chartTitle.Text = Worksheets("Sheet1").Range("B1").Value 'Move the chart to a new sheet. Name this sheet "Sales Chart" .Location Where:=xILocationAsNewSheet, Name:="Sales Chart" End With First, make a copy of Macro10 and paste it in the same module and rename it Macro20. Then, make changes to Macro20 so that it creates a chart for any selected dataset. In other words, Macro10 creates a Clustered Bar chart from a dataset located at a specific data region. You cannot use it if you want to create a Clustered Bar chart from a dataset located at a different data region. Finally, improve Macro20 so that it asks the user for a chart title and a worksheet name. You will use the InputBox() function twice for this task. region, so no workarounds!) Hint. Testing your macro on both the data regions means you will (1) highlight the region that have the data that you want to put in your chart and then (2) run your macro to ask the user for a worksheet name that you will move your chart to, e.g., if you want the "Sales Figures for Four Cities from January to March" data, first you highlight cells A3:E6, then run your macro. Don't forget adding your comments and cleaning up the macro so it looks neater. Sub Macro1() 'Add a chart onto the active sheet and select the chart ActiveSheet.Shapes.AddChart.Select With ActiveChart 'Chart type is Clustered Bar chart .ChartType =xx BarClustered 'The data set is located in cells A3:E6 of "Sheet1" worksheet .SetSourceData Source:=Worksheets("Sheet1").Range("A3:E6") 'Set a chart title, located at the top of the chart .SetElement (msoElementChartTitleAboveChart) 'Assign the content of cell B1 to the title of the chart .chartTitle.Text = Worksheets("Sheet1").Range("B1").Value 'Move the chart to a new sheet. Name this sheet "Sales Chart" .Location Where:=xILocationAsNewSheet, Name:="Sales Chart" End With

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!