Simple filter question

SteveD

Board Regular
Joined
Feb 20, 2002
Messages
104
Hi all,

I have a program that sorts a spread sheet and then filters the data both operations are performed on the same column. This way all of the data I want to see are continuous set of rows.

I'm copying the data left visible after the filter in is place to a different spreadsheet.

I'd like to place that sheet's name in the last column (AR) on the original spreadsheet. I have everything figured out except… how do I define a range that will allow me to select only the cells left in column AR after the filter has been applied (to a different column)?

Thanks for your help,
Steve
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

SteveD

Board Regular
Joined
Feb 20, 2002
Messages
104
Am I not being clear here or has this stumped everyone?
Thanks for your help.
 

tactps

Well-known Member
Joined
Jan 20, 2004
Messages
3,460
If you do the autofilter, then copy and paste, it will only pick up the visible rows. An example is:
sub macro()
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="a"
Range("B1:B9").Select
Selection.Copy
Range("E11").Select
ActiveSheet.Paste
end sub
In my example, I only pasted rows B1, B4 and B6 as they were the ones that contained "a" in column A.
 

Forum statistics

Threads
1,147,508
Messages
5,741,570
Members
423,668
Latest member
Audorin

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
Top