+ Reply to Thread
Results 1 to 1 of 1

Making Graph with Help of Macro

Hybrid View

  1. #1
    Registered User
    Join Date
    03-21-2014
    Location
    Germany
    MS-Off Ver
    Excel 2010
    Posts
    80

    Talking Making Graph with Help of Macro

    I have a Macro for making graph which I took from some big Macro code...It is not working on my excel file ...please help me to modify it so that it can work..I have attached the excel file on which i want it to run.
    It should make graph of all sheets except first sheet.
    Code is :
    Dim chartCell As Range
            Set chartCell = ws.Cells(StartRow, Col + 3)
            
            Dim xRange As Range
            Set xRange = ws.Range(ws.Cells(StartRow, 1), ws.Cells(StartRow + ShortenedIntervalLength - 1, 1))
            
            'insert Chart
            With ws.ChartObjects.Add(Left:=chartCell.Left, Top:=chartCell.Top, Width:=800, Height:=1000).Chart
                .ChartStyle = 4
                For Col = 2 To ColCount 
                    With .SeriesCollection.NewSeries
                        .ChartType = xlXYScatterSmoothNoMarkers
                        .XValues = xRange
                        .Values = ws.Range(ws.Cells(StartRow, Col), ws.Cells(StartRow + ShortenedIntervalLength - 1, Col))
                        .Name = ws.Cells(StartRow - 1, Col).Value
                    End With
                Next
                
                With .SeriesCollection.NewSeries
                    .ChartType = xlXYScatterSmoothNoMarkers
                    .XValues = xRange
                    .Values = avgRange
                    .Name = "Mittelwert"
                    .Border.Color = RGB(64, 64, 255)
                End With
                With .Axes(xlCategory, xlPrimary)
                    .HasTitle = True
                    With .AxisTitle
                        .Font.Size = 14
                        '.Font.Bold = True
                        .Characters.Text = "Zeit [s]"
                    End With
                    .HasMajorGridlines = True
                    .HasMinorGridlines = True
                End With
                With .Axes(xlValue, xlPrimary)
                    .HasTitle = True
                    With .AxisTitle
                        .Font.Size = 14
                        '.Font.Bold = True
                        .Characters.Text = "Elektrische Aktivität [µV]"
                    End With
                    .HasMajorGridlines = True
                    .HasMinorGridlines = True
                End With
            End With
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Making a line graph into a curve graph & finding the area
    By AppleMonster in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 03-28-2014, 05:37 AM
  2. Making a Graph
    By Buggy in forum Excel General
    Replies: 3
    Last Post: 07-14-2006, 03:35 PM
  3. [SOLVED] Making a bar and a line graph together
    By Santa Clause in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  4. [SOLVED] Making a bar and a line graph together
    By Santa Clause in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM
  5. Making a bar and a line graph together
    By Santa Clause in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1