Wolfgang17
Board Regular
- Joined
- Nov 8, 2010
- Messages
- 63
HI,
I am trying to copy Range W3 from sheets "Pay10" to "Pay26" in one workbook to a sheet called "Data" Range C17:C33 in another workbook.
Any help would be appreciated.
I am trying to copy Range W3 from sheets "Pay10" to "Pay26" in one workbook to a sheet called "Data" Range C17:C33 in another workbook.
Any help would be appreciated.
Code:
Sub VacationPayTransfer()
Dim wb1 As Workbook, wb2 As Workbook, i As Long
Set wb1 = Workbooks.Open("C:\Desktop\\2017 Timecard.xlsm") 'validate path
Set wb2 = Workbooks.Open("C:\Desktop\\2018 Timecard.xlsm") 'Validate path
For i = 10 To 26
wb1.Sheets("Pay" & i).Range("W3").Copy
wb2.Activate
wb2.Sheets("Data").Range("C17:C33").PasteSpecial xlPasteValues
Next
End Sub
Last edited: