Consulting

Results 1 to 5 of 5

Thread: vba code

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    vba code

    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.
    Attached Files Attached Files
    Last edited by rocks12; 10-04-2012 at 10:43 AM.

  2. #2
    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.
    Last edited by Zack Barresse; 08-11-2013 at 05:37 PM. Reason: Added CODE tags

  3. #3
    Moderator VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,003
    Location
    Is your source sheet really called "sheets 1" or should it be "Sheet1"?
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

  4. #4
    Sorry it is sheet1.

  5. #5
    Moderator VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,003
    Location
    So if you adjust your code so that it shows sheet1 instead do you still have an issue?
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •