AutoFilter Question

  • Thread starter Thread starter Michael Kintner
  • Start date Start date
M

Michael Kintner

I have made my selection:

Selection.AutoFilter Field:=1, Criteria1:=Range("Product_Name").Text

Now how do I copy that selection to a specific location?

Thank you in advance for your help!!

Mike
 
Mike,

The following assumes that A2 is in the range that has been filtered.

Range("A2").Select
Selection.CurrentRegion.Select
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.Copy
Sheets("Sheet2").Select
Range("A1").select
ActiveSheet.Paste

John
 
Mike,

From a previous post by Tom Ogilvy (a better way):

Sub Tester1()
If ActiveSheet.AutoFilterMode Then
Set rng = ActiveSheet.AutoFilter.Range
rng.Copy Destination:=Worksheets("Sheet2").Range("A1")
Else
MsgBox "No filter in place"
End If
End Sub

John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top