Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

VBA to get unique names and list these

Posted on 2013-01-11
4
417 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
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 …
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

856 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