Copy names to another sheet

W

wpreqq99

I have a list of data in a sheet named Official List. This list is
added to each day. 1 of the columns on this list shows a name of a
person. These persons show up multiple times on the list.
What I want to do is to copy each name once from this list in Official
List to another sheet named Contact List. I’ve poked around in past
posts, and couldn’t find anything close enough for me to play around
with.
I know how to copy & paste data via macro. What I don’t know is how to
make it compare the text in the cell vs the list in Contact List to
see if that name is on the list already.

I’m think of something along these lines…..

Goto Contacts (named range of column header in Official List sheet)
Down 1

Do until isempty

Read 1st cell
If cell = name from list in sheet Contact List (name already on the
list)
Then move down 1 cell
Next
Else copy that name to list.

This would loop until the 1st empty cell is found.

As always, I appreciate your help.
Thanks
jeff
 
J

Joel

Person = "John"
set c = Range("Contact
List").find(what:=Person,lookin:=xlvalues,lookat:=xlwhole)
if c is nothing then
'enter code here
else
'enter more code here
end if
 
W

wpreqq99

Person = "John"
set c = Range("Contact
List").find(what:=Person,lookin:=xlvalues,lookat:=xlwhole)
if c is nothing then
   'enter code here
else
   'enter more code here
end if











- Show quoted text -

Maybe I wasn't clear, or maybe I'm not understanding your solution.

I want to copy 1 of each name on the list. There might be 50 different
names on the list. Many of those may be on the listed 15, 20 times.
So, the list in Official List sheet might be 300 lines, and if there
were 50 different names on the list, then the list in the Contact List
sheet will be 50 names long.
Thanks for responding
 
J

Joel

Person = "John"
set c = Range("Contact List").find(what:=Person, _
lookin:=xlvalues,lookat:=xlwhole)
firstAddress = c.Address
if c is nothing then
'enter code here
else
do
'enter your code here
Set c = .FindNext(after:=c)
loop while not c is nothing And c.Address <> firstAddress
end if
 

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

Top