PDA

View Full Version : vba code



rocks12
10-04-2012, 10:29 AM
i have an excel file called report card,where there is student data containing their marks in tests held on different dates. i want to write a vba program that depicts individual student's performance in a chart,the dates where the
student's did not appear for the test is marked as n/a ,it should not be shown in the chart,kindly help.thank you.

rocks12
10-05-2012, 07:36 AM
Yeah, i have written the code in the vba module but it's giving me errorand not depicting the chart the way i want,so i think something is missing but can't understandwhere i am wrong,my code is

Sub report_card()
Charts.Add
ActiveChart.ChartType = xl3DBarClustered
ActiveChart.SetSourceData Source:=Sheets("sheets 1").Range("a1:e10")
ActiveChart.Location where:=xlLocationAsObject, Name:="sheet1"
If Date = "n/a" Then
MsgBox False
Else
End If
End Sub


please guide me.

Simon Lloyd
10-08-2012, 12:43 PM
Is your source sheet really called "sheets 1" or should it be "Sheet1"?

rocks12
10-08-2012, 09:23 PM
Sorry it is sheet1.

Simon Lloyd
10-10-2012, 09:32 AM
So if you adjust your code so that it shows sheet1 instead do you still have an issue?