Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

VBA coding: The user will input between 3 and 20 data points for two variables o

ID: 3851037 • Letter: V

Question

VBA coding:

The user will input between 3 and 20 data points for two variables on Sheet1 starting in cells A2 and B2 (the program should work if 3,4,5,...,20 data points are entered.) Column A will contain the values for variable x and column B will contain the values for the variable y. Call a sub procedure named GetInput that obtains the x and y values from Sheet1 and stores the data in a 2D array named xyvalues. Add code that will automatically generate a scatter plot containg the following information: -N data points -the best-fit line -labels for the x and y axis - chart title. This code needs to be written in VBA, so the plot shows automatically after the macro is run, meaning there is no use of the Insert-Chart options in the Excel workbook.

Explanation / Answer

The worksheet has a Range property which you can use to access cells in VBA. The Range property takes the same argument that most Excel Worksheet functions take e.g.3 to20

this code shows you how to place a value in a cell using the Range property

if any one need multiple cells using the Range property,then