PDA

View Full Version : Select Range to copy Values to



maninjapan
10-28-2011, 08:23 AM
I am trying to paste values using the following. ( I do not want to use copy/paste)
If ThisWorkbook.Worksheets("A").Range("L8").Value = 1 Then
LastRow = ThisWorkbook.Worksheets("B").Range("A" & Rows.Count).End(xlUp).Row + 1
ThisWorkbook.Worksheets("B").Range("A" & LastRow).Value = ThisWorkbook.Worksheets("A").Range("A10:G10").Value
End If



However I am unsure of the correct way to set the range I want to move the values to the way it works at the moment, it only pastes the value of A10 to A & Last Row without the rest of the range....

Any help would be much appreciated

mancubus
10-28-2011, 11:30 AM
ranges' sizes must be equal.

If Worksheets("A").Range("L8").Value = 1 Then
With Worksheets("B")
LastRow = .Range("A" & .Rows.Count).End(xlUp).Row + 1
.Range("A" & LastRow & ":G" & LastRow).Value = Worksheets("A").Range("A10:G10").Value
End With
End If