macro to copy and paste from one tab to another

xxsalahxx

Active Member
Joined
Jun 25, 2011
Messages
320
Office Version
  1. 2007
Hello
Im trying to create a macro to copy and paste all rows of data from sheet1 to sheet2
My data starts at cell A5 to approx Z5000.
Has anyone here any ideas for a macro?
Im a novice to macros really so any help is very much appreciated
Thanking you in advance
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
VBA Code:
Sub Copy_Data()
'
'
    Dim Sht1 As Worksheet
    Dim Sht2 As Worksheet
    Dim CpyRng As Range
    Dim L As Long
'
        Set Sht1 = ActiveWorkbook.Sheets("Sheet1")
        Set Sht2 = ActiveWorkbook.Sheets("Sheet2")
        L = Sht1.Cells(Rows.Count, 1).End(xlUp).Row
        Set CpyRng = Sht1.Range("A2:Z" & L)
'
    CpyRng.Copy
    Sht2.Range("A1").PasteSpecial
    Application.CutCopyMode = False
'
'
End Sub
 
Upvote 0
Thank you
I have tried to amend this as I renames my tabs on sheet
Sheet 1: RAW DATA 2MTHS (l)
Sheet 2: 1.1(L)
but i cant seem to get it to work any ideas where i am going wrong?

Data starts at cell A5 and has to copy over into cell A5.

Thank you
 
Upvote 0

Forum statistics

Threads
1,215,826
Messages
6,127,117
Members
449,359
Latest member
michael2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top