Toby logo

Chart.xls

Chart.xls can be downloaded by clicking the button below:

In this spreadsheet, you can type in an equation and it will be graphed for you. To use it, follow these instructions:

  • Opening the file
    • Open the file in Excel
    • Enable macros
  • Entering equations
    • Enter your equation into the textbox at the top
    • Click 'Plot Graph'
    • Remember: The equation should be entered using similar language to the language you would use to enter an Excel formula. The 'y=' part has already been included for you
    • For example, if you wanted a graph of the formula y=2x then you would type in 2*x into the textbox and click 'Plot Graph'
  • Axes
    • The x axis is limited to showing from -5 to +5
    • The y axis can show any scale, depending on the formula used. If the line for the equation is off the scale, then you can un tick  Lock Axes.
  • Variables and Animation
    • If you want to animate your line, enter a variable between A and G in your formula. The variable's value will be displayed next to the scroll bars. Note: Excel does not support using the letter C. Please use the letter K instead.
    • If you drag the scroll bar for the letter that you entered in the formula, the value of the variable will be modified and the chart will be recalculated using the new value for that variable.
    • For example, if you entered x+b into the textbox and dragged the scroll bar for b to the left and right, the line on the graph would move up and down
    • It is best to keep Lock Axes ticked whilst you animate the graph, for it to animate it smoothly.
    • Variables can have up to 1 decimal place and they can be anywhere between -10 and +10.
  • Viewing the source
    I have deliberately made it difficult to get very far into the file, so that you do not accidentally mess anything up
    If you do need to get deeper access to the spreadsheet, please follow the following steps
    • Go to Tools > Protection > Unprotect Sheet...
      You should not need to enter a password. This will give you access to the individual cells on the worksheet.
    • On the Drawing Toolbar, enable the 'Select Objects' tool (to the right of the Draw menu) and drag the transparent rectangle in front of the graph away. Then click the 'Select Objects' tool again
      This will give you access to the chart.
    • Go to Tools > Options and on the View tab, enable the following:
      • Row & column headers
      • Horizontal scroll bar
      • Vertical scroll bar
      • Sheet tabs

      This will give you access to the whole spreadsheet

    • To enable scrolling, press Alt + F11 to get to the Visual Basic Editor, press Ctrl + G to open the Immediate Window, type Sheets("Sheet1").Scrollarea = "" and press Enter.
    • Whilst you are in the Visual Basic Editor, you can view the code used to generate the graph
    • There is also useful data in cells N2:U103 You may need to adjust some of the colours in order to view the data more easily
    • Opening the Visual Basic toolbar and enabling Design Mode will allow you to view the properties of some of the controls
    • Going to Insert > Name > Define will allow you to see how names are used in the spreadsheet

Written by Toby. This work is licensed under a Creative Commons License. Privacy