Nayasoch
Board Regular
- Joined
- Sep 9, 2016
- Messages
- 73
Hello Everyone,
I am looking for solution to change a value of one cell from 1 to 100,( which directly link to column source of Graph Data ) with step of 1.00 each time and export each Graph i.e Total 100 in External Folder so that I could compare them and compiled them to make a Gif to show Progress of Graph
Till now for exporting Graph , I'm using this code. But I have to do it manually and it is okay to export 5-6 Graph but now I want to export 200-400 Graphs as value of A1 changes continuously from 1 to 100
I am looking for solution to change a value of one cell from 1 to 100,( which directly link to column source of Graph Data ) with step of 1.00 each time and export each Graph i.e Total 100 in External Folder so that I could compare them and compiled them to make a Gif to show Progress of Graph
Till now for exporting Graph , I'm using this code. But I have to do it manually and it is okay to export 5-6 Graph but now I want to export 200-400 Graphs as value of A1 changes continuously from 1 to 100
Code:
Public Sub ExportALLCharts()
Dim outFldr As String
Dim ws As Worksheet
Dim co As ChartObject
outFldr = GetFolder(ActiveWorkbook.Path)
If outFldr = "" Then
MsgBox "Export Cancelled"
Else
For Each ws In ActiveWorkbook.Worksheets
For Each co In ws.ChartObjects
co.chart.Export outFldr & "\" & ws.Name & ".png", "PNG"
Next co
Next ws
End If
End Sub
Function GetFolder(strPath As String) As String
Dim fldr As FileDialog
Dim sItem As String
Set fldr = Application.FileDialog(msoFileDialogFolderPicker)
With fldr
.Title = "Select folder to export all of the Figures to"
.AllowMultiSelect = False
.InitialFileName = strPath
If .Show = True Then sItem = .SelectedItems(1)
End With
GetFolder = sItem
Set fldr = Nothing
End Function