Copying all rows in a named range

tony.reynolds

Board Regular
Joined
Jul 8, 2010
Messages
97
i have a sheet i need to copy the rows in a named range

the named range is

Range("ALLUSERDATA")

it refers to A5:F10

Sorry i cant seem to find the solution on the post and help

Easy enough to copy the range but i want to be able to use the insert rows copied into another spread sheet so all the rows of data is added and all data below the inserted rows is shifted down.
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Where do you want to copy it too...?

This copies to H1 oif same sheet

Code:
Sub COPYDATA()
    Range("ALLUSERDATA").Copy Destination:=Range("H1")
End Sub
 
Upvote 0
Not sure if this is all that clear, at least to me.

Copy Rows("5:10") from Sheet1 and paste in Sheet2. Not sure where in Sheet2 so this pastes at Rows("2:2") and shifts everything down.

If this doesn't do it, then maybe some more detail as to what you are trying to accomplish.

Code:
Sub tonyr()
    Dim wsSrc As Worksheet
    Dim wsDst As Worksheet
    Set wsSrc = Sheets("Sheet1")
    Set wsDst = Sheets("Sheet2")
    Application.ScreenUpdating = False

    With wsSrc
        .Rows("5:10").Copy
    End With

    With wsDst
        .Rows("2:2").Insert Shift:=xlDown
    End With
    
ExitPoint:
    Set wsSrc = Nothing
    Set wsDst = Nothing
    Application.CutCopyMode = False
    Application.ScreenUpdating = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,719
Members
452,939
Latest member
WCrawford

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