Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I assume that your chart is a bar chart with the student's names on the x-axis and the average score on the y-axis.

If you are willing to allow your table to be sorted, here's how to automatically update the chart as you want. Record a macro that sorts your grade table by the average score. Hook the macro to the "'Modified' status was changed" event for the spreadsheet. When you change a grade the chart is updated immediately. When you save the spreadsheet, the table is sorted and the chart is again updated using the sorted data.

If you want to maintain your original table sort order then it's more complicated, but doable. Your macro should copy your table and paste it as values-only in another location, then the macro would sort the copy on the average grade. The chart would be based on the data copy, not the original data. The macro would be hooked to the 'Modified' event as above. You will want to turn off the warning about pasting into existing data.