Solved

VBA to get unique names and list these

Posted on 2013-01-11
4
419 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
[X]
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
  • 2
4 Comments
 
LVL 30

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 30

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
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.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

734 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