select and copy from one worksheet to another

mort1703

Active Member
Joined
Sep 13, 2008
Messages
266
Hi

I have a worksheet called "BILLS", this worksheet contains multiple rows of data; in essence a list of bills; I need to select all of the data and copy to another worksheet.

Can anyone help
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
start in cell A1 and do a ctrl+shift+end and copy
go to other sheet and paste where you want it
 
Upvote 0
sorry I meant using vba, I have a macro in place and want to add this routine so its automated, rather than a manual process
 
Upvote 0
Code:
        Sheets("BILLS").Select
        Range("A1:F24").Select
        Application.CutCopyMode = False
        Selection.Copy
        Sheets("APRIL BILLS").Select
        ActiveSheet.Paste

How do I adjust this code to adjust for unlimited rows, ie the number for rows required is random, at the moment I have 24 rows of data however this could change I need to make the above code a bit more robust
 
Upvote 0
Code:
Sub copy_bills()
Dim LR As Long
LR = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row

    Sheets("BILLS").Select
    Range("A1:F" & LR).Copy Destination:=Sheets("APRIL BILLS").Range("A1")
    Application.CutCopyMode = False

End Sub

HTH
 
Upvote 0

Forum statistics

Threads
1,215,064
Messages
6,122,936
Members
449,094
Latest member
teemeren

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