PDA

View Full Version : [SOLVED] Copy data to other sheet



marreco
08-21-2013, 07:19 PM
Hi.
I need to copy Range ("B28: Q35") to the last line of the tab "Plan1"



Sub copy_Data()
Dim rng As Range, WS As Worksheet
Dim n As Integer


Application.ScreenUpdating = False
With Sheets("TESTE2")
.Range("B28:Q35").End(xlUp).Copy
.[A65536].End(xlUp)(2).PasteSpecial Paste:=xlValues
End With
Sheets("Plan1").[A65536].End(xlUp)(2).PasteSpecial Paste:=xlValues
'the above lines are not working.
'I need to copy Range ("B28: Q35") to the last line of the tab "Plan1"


With Sheets("TESTE1")
Set rng = .Range("B28:Q35")
End With
I = 2
Sheets("Plan1").Rows(I).EntireRow.Resize(8).Insert
For Each WS In Sheets(Array("Plan1"))
rng.Copy Destination:=WS.Range("A2")
Next WS


Application.CutCopyMode = False

End Sub

patel
08-21-2013, 10:41 PM
LR = Sheets("Plan1").Cells(Rows.Count, "A").End(xlUp).Row +1
Sheets("TESTE2").Range("B28:Q35").Copy
Sheets("Plan1").Cells(LR,1).PasteSpecial Paste:=xlValues
Application.CutCopyMode = False

marreco
08-24-2013, 07:21 AM
Hi.is working, thank you!

snb
08-24-2013, 07:52 AM
I'd prefer:


Sub M_snb()
Sheets("Plan1").Cells(rows.count,1).end(xlup).offset(1).resize(8,16)=Sheets("TESTE2").Range("B28:Q35").Value
end sub