• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA copy range and paste it to another tab

Cele

Member
Hi,
I just typed a macro but for some reason, its not working properly. Can someone help me fix it?

I want to copy what's on the second tab, OrderForm. The range is B1 through F60, and paste it on the first tab Report. And put the cursor on the next available blank cell.

Can someone help me? Thanks.

Celeste
 

Attachments

Hello Cele.

Quite interesting question..killed my 4 hours of time but happy it's working for "B" column copy and pasting in Report sheet..need to see how to move to d and so on to copy and transpose..

Code:
Sub Cele()
Dim LastRow As Long
Dim NextRow As Long
Dim i As Long
    Application.ScreenUpdating = False
    'With Worksheets("OrderForm")
        LastRow = Worksheets("OrderForm").Cells(Worksheets("OrderForm").Rows.Count, "b").End(xlUp).Row
        For i = 1 To LastRow Step 6
            Worksheets("OrderForm").Activate
            Worksheets("OrderForm").Cells(i, "B").Resize(6).Copy
            lrow = Worksheets("Report").Cells(Worksheets("Report").Rows.Count, "A").End(xlUp).Row + 1
            Worksheets("Report").Activate
            Range("A" & lrow).PasteSpecial Paste:=xlPasteAll, Transpose:=True
        Next i
      
Application.ScreenUpdating = True
End Sub
 
Last edited:
Back
Top