happydonut
Board Regular
- Joined
- Nov 28, 2019
- Messages
- 57
- Office Version
- 365
- Platform
- Windows
Hey guys,
I want to copy a range from Sheet1 (example column F starting from row 2) and paste it in another column in Sheet2 in the first empty cell starting from B6. Can anyone help with the code?
What I have done so far, which not works:
I want to copy a range from Sheet1 (example column F starting from row 2) and paste it in another column in Sheet2 in the first empty cell starting from B6. Can anyone help with the code?
What I have done so far, which not works:
VBA Code:
Dim ws as Worksheeet
Dim ws2 as Worksheet
Set ws = Worksheets("Sheet1")
Set ws2 = Worksheets("Sheet2")
Dim wsLR As Long, ws2LR As Long
wsLR = ws.Cells(Rows.Count, "A").End(xlUp).Row
ws2LR = ws2.Cells(Rows.Count, "A").End(xlUp).Row
ws.Range("F2:F" & wsLR).Copy
ws2.Range("B6:B" & ws2LR).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues