Export And Save Chart As PNG With Custom Sequential Name
I want to have png file name as d140302.png the next one d140303.png instead of Chart 49 02-03-14_03.42.51_PM.PNG please help me i attached the png fileAttachment 1501
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