Hello,
I am trying to copy a specific data range from all 7 worksheets in one workbook (Sourcebook)to a single summary page of another workbook (Destbook).
The way I do it is as follows:
1) Open the Sourcebook
2) copy the range from Sourcebook.worksheet1
3) Paste the range in Destbook.Sheet1
4) Problem occurs when I try to copy the same range from the sourcebook.worksheet2. It seems that the previous data copied is still selected. I cannot understand where I am going wrong.
Code is presented below:
'to copy data from the workbook for every worksheet'
For TINdataIndex = 1 To 7
SourceBook.Sheets(TINdataIndex).Range(Cells(7, 26), Cells(30, 77)).Select
Selection.Copy
DestBook.Activate
DestCell.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ActiveCell.Offset(20, 0).Select
Set DestCell = ActiveCell
SourceBook.Activate
Application.ScreenUpdating = True
Next TINdataIndex
I am trying to copy a specific data range from all 7 worksheets in one workbook (Sourcebook)to a single summary page of another workbook (Destbook).
The way I do it is as follows:
1) Open the Sourcebook
2) copy the range from Sourcebook.worksheet1
3) Paste the range in Destbook.Sheet1
4) Problem occurs when I try to copy the same range from the sourcebook.worksheet2. It seems that the previous data copied is still selected. I cannot understand where I am going wrong.
Code is presented below:
'to copy data from the workbook for every worksheet'
For TINdataIndex = 1 To 7
SourceBook.Sheets(TINdataIndex).Range(Cells(7, 26), Cells(30, 77)).Select
Selection.Copy
DestBook.Activate
DestCell.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ActiveCell.Offset(20, 0).Select
Set DestCell = ActiveCell
SourceBook.Activate
Application.ScreenUpdating = True
Next TINdataIndex