Data
Name Maths English Commerce Statistics
Tony 50 90 58 69
John 70 83 60 71
Peter 48 68 74 59
Robin 68 76 85 84
James 80 89 93 85
Requirement
I have the above data which i need to see in graphical format for each student,manually I generate the graph by selecting the data of one student and then clicking the following key strokes "Step 1. Alt+n, Step 2. n Step 3. enter Key" the graph opens up like this http://www.flickr.com/photos/30257292@N02/6195426712/in/photostream , to see the next student's graph I first delete the current student's graph then select the next student's data(basically next row) and then click the same key strokes, And so on for the next student.
in case u do not understand my requirement pl. the check the pictures at the flickr site below are the links
http://www.flickr.com/photos/30257292@N02/6195426712/in/photostream
http://www.flickr.com/photos/30257292@N02/6195438878/in/photostream
What I want
A marco that will navigate and select the next row and generate the corresponding graph, before generation, it should delete the current graph.
What I tried
' Macro1 Macro
'
' Keyboard Shortcut: Ctrl+k
'
Range(Selection, Selection.End(xlToRight)).Select
ActiveSheet.Shapes.AddChart.Select
'ActiveChart.SetSourceData Source:=Range("'monitorsmall (3)'!$E$3:$K$3")
ActiveChart.ChartType = xlLine
End Sub
the above macro works but i need to manually delete the current graph and also select the range, I am not good at vb script hence i don't know to capture the current row and replace the row andcol. However this is the best I could get.
I even tried to create another macro to do the deletion, but it gave an error, here is the code
Sub graph()
'
' graph Macro
'
' Keyboard Shortcut: Ctrl+l
'
ActiveSheet.ChartObjects("Chart 7").Activate
ActiveChart.Parent.Delete
Range("D4").Select
Range(Selection, Selection.End(xlToRight)).Select
Application.Run "Book2!Chart"
End Sub
Name Maths English Commerce Statistics
Tony 50 90 58 69
John 70 83 60 71
Peter 48 68 74 59
Robin 68 76 85 84
James 80 89 93 85
Requirement
I have the above data which i need to see in graphical format for each student,manually I generate the graph by selecting the data of one student and then clicking the following key strokes "Step 1. Alt+n, Step 2. n Step 3. enter Key" the graph opens up like this http://www.flickr.com/photos/30257292@N02/6195426712/in/photostream , to see the next student's graph I first delete the current student's graph then select the next student's data(basically next row) and then click the same key strokes, And so on for the next student.
in case u do not understand my requirement pl. the check the pictures at the flickr site below are the links
http://www.flickr.com/photos/30257292@N02/6195426712/in/photostream
http://www.flickr.com/photos/30257292@N02/6195438878/in/photostream
What I want
A marco that will navigate and select the next row and generate the corresponding graph, before generation, it should delete the current graph.
What I tried
' Macro1 Macro
'
' Keyboard Shortcut: Ctrl+k
'
Range(Selection, Selection.End(xlToRight)).Select
ActiveSheet.Shapes.AddChart.Select
'ActiveChart.SetSourceData Source:=Range("'monitorsmall (3)'!$E$3:$K$3")
ActiveChart.ChartType = xlLine
End Sub
the above macro works but i need to manually delete the current graph and also select the range, I am not good at vb script hence i don't know to capture the current row and replace the row andcol. However this is the best I could get.
I even tried to create another macro to do the deletion, but it gave an error, here is the code
Sub graph()
'
' graph Macro
'
' Keyboard Shortcut: Ctrl+l
'
ActiveSheet.ChartObjects("Chart 7").Activate
ActiveChart.Parent.Delete
Range("D4").Select
Range(Selection, Selection.End(xlToRight)).Select
Application.Run "Book2!Chart"
End Sub