K
Kcope8302
This is the current macro that I am using. This would work if it would paste
starting at W. I currently use it to populate A thru V from different
worksheets. I have changed the names of the worksheets but have yet to be
able to get it to paste starting at W. The specific line that has been
causing
me issues was line 9 I believe.
Line: oCell.EntireRow.Copy Destination:=Sheets("PTR").Range("W" &
Rows.Count).End(xlUp).Offset(1, 0)
This line should paste all of the reference data line into PTR starting at
W. Can you assist with this?
Sub Copy2()
Dim Rng As Range, Rng1 As Range, MyCell As Range, oCell As Range, i As Long
Set Rng = Sheets("Reference Data").Range("A1:A" & Sheets("Reference
Data").Range("A" & Rows.Count).End(xlUp).Row)
Set Rng1 = Sheets("PTR").Range("A1:A" & Sheets("PTR").Range("A" &
Rows.Count).End(xlUp).Row)
i = 0
For Each MyCell In Rng1
For Each oCell In Rng
If oCell.Value = MyCell.Value Then
oCell.EntireRow.Copy Destination:=Sheets("PTR").Range("A" &
Rows.Count).End(xlUp).Offset(1, 0)
i = i + 1
End If
Next oCell
Next MyCell
i = 0
' Referencedata Macro
'
' Keyboard Shortcut: Ctrl+b
End Sub
starting at W. I currently use it to populate A thru V from different
worksheets. I have changed the names of the worksheets but have yet to be
able to get it to paste starting at W. The specific line that has been
causing
me issues was line 9 I believe.
Line: oCell.EntireRow.Copy Destination:=Sheets("PTR").Range("W" &
Rows.Count).End(xlUp).Offset(1, 0)
This line should paste all of the reference data line into PTR starting at
W. Can you assist with this?
Sub Copy2()
Dim Rng As Range, Rng1 As Range, MyCell As Range, oCell As Range, i As Long
Set Rng = Sheets("Reference Data").Range("A1:A" & Sheets("Reference
Data").Range("A" & Rows.Count).End(xlUp).Row)
Set Rng1 = Sheets("PTR").Range("A1:A" & Sheets("PTR").Range("A" &
Rows.Count).End(xlUp).Row)
i = 0
For Each MyCell In Rng1
For Each oCell In Rng
If oCell.Value = MyCell.Value Then
oCell.EntireRow.Copy Destination:=Sheets("PTR").Range("A" &
Rows.Count).End(xlUp).Offset(1, 0)
i = i + 1
End If
Next oCell
Next MyCell
i = 0
' Referencedata Macro
'
' Keyboard Shortcut: Ctrl+b
End Sub