Results 1 to 3 of 3

Thread: insert line graph for each column separatly with vb

  1. #1
    Junior Member
    Join Date
    Feb 2014
    Posts
    24
    Rep Power
    0

    insert line graph for each column separatly with vb

    hi
    i want to have line graphs for each column and save the graphs in png form like below an example was attached


    Attachment 1494

  2. #2
    Senior Member LalitPandey87's Avatar
    Join Date
    Sep 2011
    Posts
    222
    Rep Power
    14
    Add data column manually and Try below code to export chart as PNG file:

    Code:
    Sub Lalit_Test()
    
        With ThisWorkbook.Worksheets("Sheet2")
            .ChartObjects("Chart 5").Chart.Export ThisWorkbook.Path & Application.PathSeparator & "Chart_5_" & Format(Now, "DD-MM-YY_HH.MM.SS_AM/PM") & ".PNG"
        End With
    
    End Sub
    Last edited by LalitPandey87; 02-27-2014 at 08:26 AM.

  3. #3
    Member p45cal's Avatar
    Join Date
    Oct 2013
    Posts
    94
    Rep Power
    12
    and a tweak to plot and export multiple charts from Worksheet "min max & march of khamir"
    Code:
    Sub blah()
    With ThisWorkbook.Worksheets("min max & march of khamir")
      For i = 1 To 61 Step 2
        lr = .Cells(Rows.Count, i + 1).End(xlUp).Row
        .ChartObjects("Chart 2").Chart.SetSourceData Source:=.Range(.Cells(1, i), .Cells(lr, i + 1))
        .ChartObjects("Chart 2").Chart.Export ThisWorkbook.Path & Application.PathSeparator & "Chart " & Format(i, "00") & " " & Format(Now, "DD-MM-YY_HH.MM.SS_AM/PM") & ".PNG"
      Next i
    End With
    End Sub

Similar Threads

  1. Replies: 1
    Last Post: 06-26-2014, 12:50 PM
  2. Replies: 2
    Last Post: 09-19-2013, 10:17 AM
  3. Replies: 13
    Last Post: 08-03-2013, 05:58 PM
  4. How To Create A Graph In Excel
    By rich_cirillo in forum Excel Help
    Replies: 6
    Last Post: 06-22-2013, 04:55 PM
  5. Multiple graph in userform
    By Tony in forum Excel Help
    Replies: 3
    Last Post: 10-20-2012, 09:32 AM

Posting Permissions

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