Solved

VBA to get unique names and list these

Posted on 2013-01-11
4
418 Views
Last Modified: 2013-01-12
Hello,

I have a spreadsheet (as attached) which has two tabs. One tab has a list of names in the F column. I would like to have a macro (VBA) which would look at column F and strip out all the unique names and list these on the second tab (Sheet 2) from A2 onwards.

Would this be possible?

Many thanks,

GISVPN
Example-1.xlsx
0
Comment
Question by:gisvpn
  • 2
4 Comments
 
LVL 29

Expert Comment

by:gowflow
ID: 38769547
Is this what you want ?

I hv draged the formula to show on the first 100 rows if you need more here is how to do it. You click on A1 and then press F2 so you go in edit mode then you press CTRL SHIFT while holding them you press ENTER this will create an array formula. Then you drag this formula from A1 to as many rows as you want.

gowflow
Example-1.xlsx
0
 

Author Comment

by:gisvpn
ID: 38769558
Hi Gowflow,

Unfortunately I need this as a VBA script as I need to do more things with it ;)

Thanks,

GISVPN
0
 
LVL 40

Accepted Solution

by:
als315 earned 500 total points
ID: 38769583
You can record macro. It will be like to:
   Columns("F:F").Select
    Selection.Copy
    Sheets("Sheet2").Select
    Columns("A:A").Select
    ActiveSheet.Paste
    Application.CutCopyMode = False
    ActiveSheet.Range("$A$1:$A$128").RemoveDuplicates Columns:=1, Header:=xlYes

Open in new window

0
 
LVL 29

Expert Comment

by:gowflow
ID: 38769626
Here you are u hv both. I surely did not know that RemoveDuplicates property exists !!! wow.
nice als315.
gowflow
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question