View Full Version : insert line graph for each column separatly with vb
CORAL
02-26-2014, 10:43 PM
hi
i want to have line graphs for each column and save the graphs in png form like below an example was attached
1494
LalitPandey87
02-27-2014, 08:21 AM
Add data column manually and Try below code to export chart as PNG file:
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
p45cal
02-27-2014, 05:01 PM
and a tweak to plot and export multiple charts from Worksheet "min max & march of khamir"
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
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.