Very difficult, please help with copy

R

Richard

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

Worksheets("Sent to Assembly").Range("a3:c100").EntireRow.Copy
Destination:=Worksheets("Parts Sent to Assembly").Range("a3:c100")

End Sub

Can anyone help changing this code to what I need, please!
I'm trying to somehow keep the contents of the "Parts Sent to Assembly"
after the "Sent to Assembly" contents have been deleted. After the contents
are deleted from the "Sent to Assembly" and New data is entered only the New
data is copied to the "Parts Sent to Assembly. Is there a way to keep the
contents of the "Parts Sent to Assembly" and the new data from the "Sent to
Assembly" be added to the next blank row. I need to keep track of all the
"Parts Sent to Assembly" but I do not need to keep track of the "Sent to
Assembly" once it is deleted. Thanks so much in advance!!!
 
O

Otto Moehrbach

Richard
If you want to copy A3:C100 then take out the "EntireRow" phrase.
And if you want that range pasted to A3:C100 of the other sheet, paste it to
A3 only. Your sub should look like this:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Worksheets("Sent to Assembly").Range("a3:c100").Copy
Worksheets("Parts Sent to Assembly").Range("a3").PasteSpecial
End Sub
HTH Otto
 
R

Richard

Thanks so much for your help, but it still will not keep the contents on
"Parts Sent to Assembly" once "Sent to Assembly is deleted.
 
O

Otto Moehrbach

Richard
Are you aware that the macro you are using fires when any cell in the
entire sheet is selected? Are you saying that you make the copy, then you
delete the source of the copy, and the destination of the copy is blank?
That is as it should be. The macro below will not delete the destination if
A3 of the destination is occupied. Does that do what you want? HTH Otto
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If IsEmpty(Sheets("Parts Sent to Assembly").Range("a3").Value) Then
Worksheets("Sent to Assembly").Range("a3:c100").Copy
Worksheets("Parts Sent to Assembly").Range("a3").PasteSpecial
End If
End Sub
 
R

Richard

Whenever data is entered in "Sent to Assembly" that data is sent each time to
the "Parts Sent to Assembly" row after row after row. Lets say I'm on row 100
when I delete the contents of "Sent to Assembly" When new data is entered in
"Sent to Assembly" it should then appear on the "Parts Sent to Assembly" on
row 101. God bless you for your help!!
 
O

Otto Moehrbach

Richard
I don't think you want to use a Worksheet_SelectionChange macro. Tell
me exactly why you chose that macro.
To paste it in the first empty row (below what you pasted before) use
something like this:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
With Sheets("Parts Sent to Assembly").
Worksheets("Sent to Assembly").Range("a3:c100").Copy
.Range("A" & Rows.Count).End(xlUp).Offset(1).PasteSpecial
End With
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top