Hello kumar lama,
This code entered into the summary workbook open module might do something like what you want. Not very elegant but put together fairly quickly.
Private Sub Workbook_Open()
Dim wb As Workbook, wbb As Workbook
Dim strSourceWB As String, strTargetWB As String
Dim range1 As String, range2 As String, range3 As String
Dim a As Range, b As Range, c As Range, d As Range, e As Range, f As Range, g As Range
strSourceWB = "C:\Users\Harry\Documents\excel\copy_source.xlsx" 'C:\Users\Samsung\Desktop\Samsung File\Main File.Xls
strTargetWB = "C:\Users\Harry\Documents\excel\copy_test.xlsm" 'C:\Users\Samsung\Desktop\Samsung File\Summery File.Xls
Set wbb = ThisWorkbook
Application.ScreenUpdating = False ' turn off the screen updating
Application.StatusBar = "Copying data from " & strSourceWB & "..."
On Error Resume Next ' ignore errors
' open the source workbook, read only
Set wb = Workbooks.Open(strSourceWB, True, True)
On Error GoTo 0 ' stop when errors occur
'set up the ranges to be copied from source file
Set a = wb.Sheets("Sheet1").Range(range1, Range(range1).End(xlDown))
Set b = a.Offset(0, 1)
Set c = a.Offset(0, 3)
Set d = a.Offset(0, 5)
Set e = a.Offset(0, 13)
Set f = a.Offset(0, 10)
range2 = Union(a, b, c, d, e).Address
range3 = f.Address
If Not wb Is Nothing Then ' opened the workbook
On Error Resume Next ' ignore errors
With wb.Worksheets("Sheet1").Range(range2)
.Copy wbb.Worksheets("Sheet1").Range("A1")
End With
With wb.Worksheets("Sheet1").Range(range3)
.Copy wbb.Worksheets("Sheet1").Range("F1")
End With
On Error GoTo 0 ' stop when errors occur
wb.Close False ' close the source workbook without saving changes
Set wb = Nothing ' free memory
End If
Application.StatusBar = False ' reset status bar
Application.ScreenUpdating = True ' turn on the screen updating
End Sub
Regards
Harry