Dear Sir,
if i am trying a column to be copied into destination sheet from multiple workbooks it is override a copied columns in summary sheet. means last workbooks column values is reflecting with only single column. please help for this issue.
please find the below code.
Sub CopyRange()
Application.ScreenUpdating = False
Dim wkbDest As Workbook
Dim wkbSource As Workbook
Set wkbDest = ThisWorkbook
Const strPath As String = "C:\Users\manojm\Documents\INJECTION reports\"
ChDir strPath
strExtension = Dir("*.xls*")
Do While strExtension <> ""
Set wkbSource = Workbooks.Open(strPath & strExtension)
With wkbSource
.Sheets("REL-D").Range("CW1:CW" & Cells(Rows.Count, 1).End(xlUp).Row).Copy wkbDest.Sheets("REL-D").Cells(1, Columns.Count).End(xlToLeft).Offset(0, 0)
.Close savechanges:=False
End With
strExtension = Dir
Loop
Application.ScreenUpdating = True
End Sub
if i am trying a column to be copied into destination sheet from multiple workbooks it is override a copied columns in summary sheet. means last workbooks column values is reflecting with only single column. please help for this issue.
please find the below code.
Sub CopyRange()
Application.ScreenUpdating = False
Dim wkbDest As Workbook
Dim wkbSource As Workbook
Set wkbDest = ThisWorkbook
Const strPath As String = "C:\Users\manojm\Documents\INJECTION reports\"
ChDir strPath
strExtension = Dir("*.xls*")
Do While strExtension <> ""
Set wkbSource = Workbooks.Open(strPath & strExtension)
With wkbSource
.Sheets("REL-D").Range("CW1:CW" & Cells(Rows.Count, 1).End(xlUp).Row).Copy wkbDest.Sheets("REL-D").Cells(1, Columns.Count).End(xlToLeft).Offset(0, 0)
.Close savechanges:=False
End With
strExtension = Dir
Loop
Application.ScreenUpdating = True
End Sub