tohobaby
New Member
Hi all, this has been trouble me for few month already.
I wish to know whether is there any possible to trace out the chart by using file path.
I have my main master file which can trace out all file path in a folder.
Inside my excel file will contain few chart.
Is there any possible when I click on TRACE button in my main master file, it will auto trace out the chart which from the file path?
Currently I have my code as below which is able to pull out the data but I am not sure how to pull out the chart.
I have been research for few month already but there is no any outcome...
Here will be the code that I use to trace out the data:
This will be the overlook for the excel file :
I wish my outcome for my main master file will look like this :
I wish to know whether is there any possible to trace out the chart by using file path.
I have my main master file which can trace out all file path in a folder.
Inside my excel file will contain few chart.
Is there any possible when I click on TRACE button in my main master file, it will auto trace out the chart which from the file path?
Currently I have my code as below which is able to pull out the data but I am not sure how to pull out the chart.
I have been research for few month already but there is no any outcome...
Here will be the code that I use to trace out the data:
Code:
Sub FetchData()
Application.ScreenUpdating = False
Dim shDestin As Worksheet
Dim cel As Range
Set shDestin = ThisWorkbook.Sheets("Sheet1")
' Dim shDestin As Worksheet
'Dim cel As Range
For Each cel In Range("B11:B12") '~~> or any range you want
CopyFileContent cel.Value & shDestin.Range("A1").Value _
, shDestin, cel.Row
Next
'End If
End Sub
Sub CopyFileContent(filePath As String, destSheet As Worksheet, destRow As Long)
Dim wbSource As Workbook, shSource As Worksheet, rngDest As Range
'If Len(Range("B10").Value) > 0 Then
Set wbSource = Workbooks.Open(Filename:=filePath)
Set shSource = wbSource.Sheets("Sheet1")
'start from where to paste | 1 sub got 9 sub
Set rngDest = destSheet.Cells(destRow, 5).Resize(1, 9)
'ni copy frm the file contect in folder
rngDest.Value = shSource.Range("C2:K2").Value
'au
rngDest.Offset(0, 9).Value = shSource.Range("C3:K3").Value
'pd
rngDest.Offset(0, 18).Value = shSource.Range("C4:K4").Value
wbSource.Close False
'End If
End Sub
This will be the overlook for the excel file :
I wish my outcome for my main master file will look like this :