SomeRandomGuy
New Member
- Joined
- Apr 24, 2019
- Messages
- 2
Hi
I have two sheets that I'm trying to paste between; my source sheet and my target sheet. My VBA is working with the copy / paste however I want to offset the paste so it starts on a specific row.
The source rows start in cell A1 and I want the pasting in the target sheet to start in B5. All of the rows should still be copied. At the moment it copies to B1 in the target sheet.
Code:
_______________
Sub setNames()
Dim nEndRow As Long
Dim a As Long
Dim avail As Worksheet
Dim StartCell As Range
Set avail = Worksheets("Sheet1")
Sheets("workbook_002").Select
Range("A1").Select
nEndRow = Range("a" & Rows.Count).End(xlUp).Row
For a = 1 To nEndRow
nteam = Left(Cells(a, 1).Value, 16)
nname = Mid(Cells(a, 1).Value, 18, 50)
avail.Cells(a, 2) = nname
avail.Cells(a, 3) = nteam
Next a
End Sub
I have two sheets that I'm trying to paste between; my source sheet and my target sheet. My VBA is working with the copy / paste however I want to offset the paste so it starts on a specific row.
The source rows start in cell A1 and I want the pasting in the target sheet to start in B5. All of the rows should still be copied. At the moment it copies to B1 in the target sheet.
Code:
_______________
Sub setNames()
Dim nEndRow As Long
Dim a As Long
Dim avail As Worksheet
Dim StartCell As Range
Set avail = Worksheets("Sheet1")
Sheets("workbook_002").Select
Range("A1").Select
nEndRow = Range("a" & Rows.Count).End(xlUp).Row
For a = 1 To nEndRow
nteam = Left(Cells(a, 1).Value, 16)
nname = Mid(Cells(a, 1).Value, 18, 50)
avail.Cells(a, 2) = nname
avail.Cells(a, 3) = nteam
Next a
End Sub