The next 10 rows?

Tarqs

Board Regular
Joined
Feb 14, 2011
Messages
120
I have recorded the Macro below but I need to amend, to look at the next ten rows and not just the range shown in the selection. The below assumes I always want these specific cells but i need filter and sort this data so it might not be those specifics cells everytime.

Code:
Sub Test()
    Range("H10:H19").Select
    Selection.Copy
End Sub

Help much appreciated
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
'next ten rows' in relation to what?

Maybe

Code:
ActiveSheet.Cells(ActiveCell.Row, 8).Resize(10).Copy
 
Upvote 0
Your absolutely right i should have put more information.

I have recorded this

Code:
Sub Macro7()
    ActiveSheet.Range("$A$9:$BA$1556").AutoFilter Field:=9, Criteria1:="10", _
        Operator:=xlTop10Items
    ActiveWorkbook.Worksheets("x_Master Production").AutoFilter.Sort.SortFields. _
        Clear
    ActiveWorkbook.Worksheets("x_Master Production").AutoFilter.Sort.SortFields. _
        Add Key:=ActiveCell.Offset(-1, 0).Range("A1:A1548"), SortOn:=xlSortOnValues _
        , Order:=xlDescending, DataOption:=xlSortTextAsNumbers
    With ActiveWorkbook.Worksheets("x_Master Production").AutoFilter.Sort
        .Header = xlYes
        .MatchCase = False
        .Orientation = xlTopToBottom
        .SortMethod = xlPinYin
        .Apply
    End With
    ActiveCell.Offset(0, 8).Range("A1:A935").Select
    Selection.Copy
End Sub

what i need is to be able to copy the first 10 rows beneath my header row at row 9. My issue is that once filtered it could be any row number?

Hope i'm making sense?

Tarqs
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,289
Members
452,902
Latest member
Knuddeluff

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