View Single Post
 
Old 07-28-2011, 08:09 AM
Catalin.B Catalin.B is offline Windows Vista Office 2007
Expert
 
Join Date: May 2011
Location: Iaşi, Romānia
Posts: 386
Catalin.B is on a distinguished road
Default

Try this (same macro in sample attached):
Sub SchimbaCap2()
Dim Myrange As Range
Dim nextRow As Long

Dim r1, r2, r3 As Range
Set r1 = Sheets("Hoja2").Range("A5:A15")
Set r2 = Sheets("Hoja3").Range("A5:A15")
Set r3 = Sheets("Hoja4").Range("A5:A15")
Application.ScreenUpdating = False
Set Myrange = r1
nextRow = Sheets("Hoja5").Range("A" & Rows.Count).End(xlUp).row + 1
Myrange.Copy
Sheets("Hoja5").Range("A" & nextRow).PasteSpecial (xlPasteValues)

Set Myrange = r2
nextRow = Sheets("Hoja5").Range("A" & Rows.Count).End(xlUp).row + 1
Myrange.Copy
Sheets("Hoja5").Range("A" & nextRow).PasteSpecial (xlPasteValues)

Set Myrange = r3
nextRow = Sheets("Hoja5").Range("A" & Rows.Count).End(xlUp).row + 1
Myrange.Copy
Sheets("Hoja5").Range("A" & nextRow).PasteSpecial (xlPasteValues)

On Error GoTo 0
Application.CutCopyMode = False
Worksheets("Hoja5").Activate
Application.ScreenUpdating = True
End Sub
Attached Files
File Type: xlsm example.xlsm (20.2 KB, 9 views)
Reply With Quote