yinkajewole
Active Member
- Joined
- Nov 23, 2018
- Messages
- 281
I would like to copy the data from B1 to B5 of each sheet of a workbook to each sheet of another workbook maintaining the same B1 to B5
Last edited:
Sub Copy_Range()
'Modified 6/23/2019 11:30:12 PM EDT
Application.ScreenUpdating = False
Dim i As Long
For i = 1 To Workbooks("Book1").Sheets.Count
Workbooks("Book1").Sheets(i).Range("B1:B5").Copy Workbooks("Book2").Sheets(i).Range("B1")
Next
Application.ScreenUpdating = True
End Sub
Try this:
You did not provide WorkBook names so you will need to modify them to your needs
I'm assuming WorkBook2 has at least as many sheets as WorkBook1
Both Workbooks must be open
Run this script from WorkBook1
Code:Sub Copy_Range() 'Modified 6/23/2019 11:30:12 PM EDT Application.ScreenUpdating = False Dim i As Long For i = 1 To Workbooks("Book1").Sheets.Count Workbooks("Book1").Sheets(i).Range("B1:B5").Copy Workbooks("Book2").Sheets(i).Range("B1") Next Application.ScreenUpdating = True End Sub
It's always easier to provide help when you provide specific details like WorkBook names.You may not worry, I've got a workround for it
(Untested) You could change the .copy to = but the size of ranges may need to be the same or you could adjust the size of the target while copying to the same size as the source
Set F_W=thisworkbook.worksheets(Name of sheet where picture is found)
Set S_W=Workbooks("Second Workbook Name").worksheets("Target Sheet Name")
Set Pic=F_W.pictures("name of picture found in the selection pane in First workbook")
Pic.copy
S_W.range("A1").Select
S_W.paste