Help me with this macro

rcdgreat

New Member
Joined
Mar 17, 2011
Messages
13
I need help in creating this macro. What I would want to do is when filter to a specified value the macro will automatically select the filtered rows but here's the catch it would select how many rows in the filtered rows depending on a value given.

For Example sorry if it's quite confusing to discuss:

Assuming I have already filtered column A for cell containing value named "Sample" out of 400 records it have filtered 48 records. And I would only want 10 out of the 48 records to be copied in another sheet.

Please help thanks. More power.
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
The only way I could think of doing this would be:

Code:
Sub Selection()
    Cells(1, 1).Offset(10, 0).Select
    Rows("1:" & ActiveCell.Row).Copy
End Sub

Assuming Headers in Row 1 this will copy the Headers and the Next 10 Rows.
 
Upvote 0

Forum statistics

Threads
1,224,597
Messages
6,179,808
Members
452,944
Latest member
2558216095

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