macro to scan list

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

If anyone can help that would be great,

I need a macro to scan a list of text in column A of sheet1, several text
names are repeated multiple times in this column. I then want the macro to
return only one cell of each text name that occurs in the list to column B
on sheet2.

I know this should be easy, but Im still learing. Thanks!
 
Hi Matto;

This will do what your talking about on the same sheet.
Excel will not let you do a unique filter to a different
location on a different sheet.

Sub Macro1()
Range("A1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.AdvancedFilter Action:=xlFilterCopy,
CopyToRange:=Range("B1" _
), Unique:=True


End Sub

Thanks,

Greg
 
Hi,
This functionality already exists in Excel:
-select your data (column A) including the header name.
-menu Data > Filter > Advanced Filter:
Action: Copy to another location
Criteria Range: <leave blank>
Copy To: $B$1 <---- to copy to column B
Unique Record Only: make sure it is checked
Click OK
Done!

Comment: the feature doesn't allow you to send the filtered data to another
sheet though. However, you can use it to filter within the same sheet as we
just did, then copy the result to the other sheet.

Regards,
Sebastien
 

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